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

Commit

Permalink
Make sure input.size is attribute.
Browse files Browse the repository at this point in the history
   - Will get IndexSizeError when set input.size="auto".
   - Make 'size' an attribute, so that always use dom.setAttribute.
  • Loading branch information
cyjia committed Oct 2, 2015
1 parent 90fa31f commit 88c3a16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/dom-helper/lib/prop.js
Expand Up @@ -57,7 +57,10 @@ var ATTR_OVERRIDES = {
// Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false
// Safari 8.0.7: 'autocorrect' in document.createElement('input') === false
// Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true
autocorrect: true
autocorrect: true,
// Will throw an exception(https://github.com/emberjs/ember.js/issues/12413),
// if you set input.size = 'auto'
size: true
},

// element.form is actually a legitimate readOnly property, that is to be
Expand Down
3 changes: 2 additions & 1 deletion packages/dom-helper/tests/prop-test.js
Expand Up @@ -3,7 +3,7 @@ import { normalizeProperty } from 'dom-helper/prop';
QUnit.module('dom-helper prop');

test('type.attr, for element props that for one reason or another need to be treated as attrs', function() {
expect(13);
expect(14);

[
{ tagName: 'TEXTAREA', key: 'form' },
Expand All @@ -12,6 +12,7 @@ test('type.attr, for element props that for one reason or another need to be tre
{ tagName: 'INPUT', key: 'list' },
{ tagName: 'INPUT', key: 'form' },
{ tagName: 'INPUT', key: 'autocorrect' },
{ tagName: 'INPUT', key: 'size' },
{ tagName: 'OPTION', key: 'form' },
{ tagName: 'INPUT', key: 'form' },
{ tagName: 'BUTTON', key: 'form' },
Expand Down

0 comments on commit 88c3a16

Please sign in to comment.