Skip to content

Commit

Permalink
[FEATURE beta] Add minlength to TextSupport
Browse files Browse the repository at this point in the history
Add `minlength` attribute binding to `TextSupport`.

Fixes #15243
  • Loading branch information
Serabe committed Jun 1, 2017
1 parent e4f4b8f commit c9864f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/ember-glimmer/tests/integration/helpers/input-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
placeholder=placeholder
name=name
maxlength=maxlength
minlength=minlength
size=size
tabindex=tabindex
}}`, {
Expand All @@ -133,6 +134,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
placeholder: 'Original placeholder',
name: 'original-name',
maxlength: 10,
minlength: 5,
size: 20,
tabindex: 30
}
Expand All @@ -143,6 +145,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
this.assertAttr('placeholder', 'Original placeholder');
this.assertAttr('name', 'original-name');
this.assertAttr('maxlength', '10');
this.assertAttr('minlength', '5');
// this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce)
// this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce)

Expand All @@ -153,6 +156,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
this.assertAttr('placeholder', 'Original placeholder');
this.assertAttr('name', 'original-name');
this.assertAttr('maxlength', '10');
this.assertAttr('minlength', '5');
// this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce)
// this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce)

Expand All @@ -162,6 +166,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
set(this.context, 'placeholder', 'Updated placeholder');
set(this.context, 'name', 'updated-name');
set(this.context, 'maxlength', 11);
set(this.context, 'minlength', 6);
// set(this.context, 'size', 21); //NOTE: failing in IE (TEST_SUITE=sauce)
// set(this.context, 'tabindex', 31); //NOTE: failing in IE (TEST_SUITE=sauce)
});
Expand All @@ -171,6 +176,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
this.assertAttr('placeholder', 'Updated placeholder');
this.assertAttr('name', 'updated-name');
this.assertAttr('maxlength', '11');
this.assertAttr('minlength', '6');
// this.assertAttr('size', '21'); //NOTE: failing in IE (TEST_SUITE=sauce)
// this.assertAttr('tabindex', '31'); //NOTE: failing in IE (TEST_SUITE=sauce)

Expand All @@ -180,6 +186,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
set(this.context, 'placeholder', 'Original placeholder');
set(this.context, 'name', 'original-name');
set(this.context, 'maxlength', 10);
set(this.context, 'minlength', 5);
// set(this.context, 'size', 20); //NOTE: failing in IE (TEST_SUITE=sauce)
// set(this.context, 'tabindex', 30); //NOTE: failing in IE (TEST_SUITE=sauce)
});
Expand All @@ -189,6 +196,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
this.assertAttr('placeholder', 'Original placeholder');
this.assertAttr('name', 'original-name');
this.assertAttr('maxlength', '10');
this.assertAttr('minlength', '5');
// this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce)
// this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce)
}
Expand All @@ -201,6 +209,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
placeholder="Original placeholder"
name="original-name"
maxlength=10
minlength=5
size=20
tabindex=30
}}`
Expand All @@ -211,6 +220,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
this.assertAttr('placeholder', 'Original placeholder');
this.assertAttr('name', 'original-name');
this.assertAttr('maxlength', '10');
this.assertAttr('minlength', '5');
// this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce)
// this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce)

Expand All @@ -221,6 +231,7 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
this.assertAttr('placeholder', 'Original placeholder');
this.assertAttr('name', 'original-name');
this.assertAttr('maxlength', '10');
this.assertAttr('minlength', '5');
// this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce)
// this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce)
}
Expand Down
1 change: 1 addition & 0 deletions packages/ember-views/lib/mixins/text_support.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export default Mixin.create(TargetActionSupport, {
'disabled',
'form',
'maxlength',
'minlength',
'placeholder',
'readonly',
'required',
Expand Down

0 comments on commit c9864f5

Please sign in to comment.