Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] File element type #14753

Merged
merged 1 commit into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/ember-glimmer/lib/components/text_field.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Component from '../component';
import layout from '../templates/empty';
import { TextSupport } from 'ember-views';

let inputTypeTestElement;
const inputTypes = Object.create(null);
function canSetTypeOfInput(type) {
if (type in inputTypes) {
Expand All @@ -23,9 +22,7 @@ function canSetTypeOfInput(type) {
return type;
}

if (!inputTypeTestElement) {
inputTypeTestElement = document.createElement('input');
}
let inputTypeTestElement = document.createElement('input');

try {
inputTypeTestElement.type = type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,13 @@ moduleFor('Helpers test: {{input}}', class extends InputRenderingTest {
keyCode: 65
});
}

['@test GH#14727 can render a file input after having had render an input of other type']() {
this.render(`{{input type="text"}}{{input type="file"}}`);

this.assert.equal(this.$input()[0].type, 'text');
this.assert.equal(this.$input()[1].type, 'file');
}
});

moduleFor('Helpers test: {{input}} with dynamic type', class extends InputRenderingTest {
Expand Down