Skip to content

Commit

Permalink
x-select manually set form attribute
Browse files Browse the repository at this point in the history
Glimmer currently doesn't support binding the `form` attribute because
of how it detects settable attributes vs properties.

See emberjs/ember.js#11221
  • Loading branch information
James A. Rosen committed Jun 28, 2015
1 parent 14ee050 commit b693a37
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addon/components/x-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var isArray = Ember.isArray;
export default Ember.Component.extend({
tagName: "select",
classNameBindings: [":x-select"],
attributeBindings: ['disabled', 'tabindex', 'multiple', 'name', 'autofocus', 'form', 'required', 'size'],
attributeBindings: ['disabled', 'tabindex', 'multiple', 'name', 'autofocus', 'required', 'size'],

/**
* Bound to the `disabled` attribute on the native <select> tag.
Expand Down Expand Up @@ -129,6 +129,10 @@ export default Ember.Component.extend({
return Ember.A();
}),

_setFormAttribute: Ember.on('didRender', function() {
this.$().attr('form', this.get('form'));
}),

/**
* When the select DOM event fires on the element, trigger the
* component's action with the current value.
Expand Down

0 comments on commit b693a37

Please sign in to comment.