I have the following element in an Ember view:
{{view Ember.TextField size="30" valueBinding="urlSearch.search_url"}}
But when I inspect the rendered element, the size attribute is not in the element:
<input id="ember346" class="ember-view ember-text-field" type="text" value="http://www.bdec-online.com/bd-cmpy/bd-cz.cfm">
Can anyone tell me how can I set the size attribute of an Ember.TextField?
I've just submitted a pull request to add size and maxlength to Ember.TextSupport:
https://github.com/emberjs/ember.js/pull/545
While you're waiting for that, you could patch Ember.TextField like this:
Ember.TextField.reopen({
attributeBindings: ['size', 'maxlength']
});
More info:
{{view Em.TextField attributeBindings="size" size="10"}}
Or:
App.MyTextField = Em.TextField.extend({
attributeBindings: ['size'],
size: 2
});
{{view App.MyTextField}}
Em.TextField
defines size
as a binding but it appears you have to redefine it in your subclass... but I'm I noob at Ember so what do I know.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With