Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #363 from rwjblue/input-list
Browse files Browse the repository at this point in the history
Force <input> `list` to be set as an attribute.
  • Loading branch information
mixonic committed Jun 7, 2015
2 parents 6ee93f3 + 9d815e9 commit 29d16cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions packages/dom-helper/lib/prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ var badPairs = [{
// if you set input.type = 'something-unknown'
tagName: 'INPUT',
propName: 'type'
}, {
// Some versions of IE (IE8) throw an exception when setting
// `input.list = 'somestring'`:
// https://github.com/emberjs/ember.js/issues/10908
// https://github.com/emberjs/ember.js/issues/11364
tagName: 'INPUT',
propName: 'list'
}];

function isSettable(element, attrName) {
Expand Down
9 changes: 5 additions & 4 deletions packages/dom-helper/tests/prop-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { normalizeProperty } from 'dom-helper/prop';
QUnit.module('dom-helper prop');

test('returns `undefined` for special element properties that are non-compliant in certain browsers', function() {
expect(2);
expect(3);

var badPairs = [
{ tagName: 'BUTTON', key: 'type' },
{ tagName: 'INPUT', key: 'type' }
{ tagName: 'INPUT', key: 'type' },
{ tagName: 'INPUT', key: 'list' }
];

badPairs.forEach(function(pair) {
Expand All @@ -24,4 +25,4 @@ test('returns `undefined` for special element properties that are non-compliant
var actual = normalizeProperty(element, pair.key);
equal(actual, undefined);
});
});
});

0 comments on commit 29d16cf

Please sign in to comment.