Skip to content

Commit 75bb003

Browse files
committedMay 22, 2018
Fix IE11 Value
IE11 misreports the value of the input. The root problem is described at the following URL: emberjs/ember.js#14712 Resolves yapplabs#52
1 parent de23126 commit 75bb003

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
 

‎addon/components/radio-button-input.js

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export default Component.extend({
3535
'ariaDescribedby:aria-describedby'
3636
],
3737

38+
didRender() {
39+
// Required for IE11 to correctly report its value
40+
this.$().val(this.get('value'));
41+
},
42+
3843
checked: computed('groupValue', 'value', function() {
3944
return isEqual(this.get('groupValue'), this.get('value'));
4045
}).readOnly(),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { moduleForComponent, test } from 'ember-qunit';
2+
import hbs from 'htmlbars-inline-precompile';
3+
4+
moduleForComponent('radio-button-input', 'Integration | Component | radio button input', {
5+
integration: true
6+
});
7+
8+
// NOTE Be sure that this test passes in IE11!
9+
test('reports its value on the change event', function(assert) {
10+
let expectedVal = 'blue';
11+
12+
this.set('changed', function(val) {
13+
assert.equal(val, expectedVal);
14+
});
15+
16+
this.set('value', expectedVal);
17+
18+
this.render(hbs`{{radio-button-input value=value changed=(action changed)}}`);
19+
20+
this.$('input').change();
21+
});

0 commit comments

Comments
 (0)
Please sign in to comment.