-
Notifications
You must be signed in to change notification settings - Fork 193
input.type IE issue #380
Comments
This extends a bit further: IE < 9 can't change the input's var input = document.createElement('input');
input.type = 'text';
var form = document.createElement('form');
form.appendChild(input);
input.setAttribute('type', 'password'); // Throws error |
i have removed fragment or body ancestored, and left merely any tree. Does that sound accurate? |
I was actually trying to point that |
Is that for only < IE9, if so. Im not sure what we should do about that other then tell me its just isn't supported. |
I've never tested on IE 9. jQuery claims it's just 8 and lower:
I think you can get around it with |
Where are we with this issue? I've tried the alternative to use |
@stefanpenner any updates? it's been quite a bit |
By now we have decided (together with business reps) to drop support for IE8 in future version (thank you, finally) hence we are not depending on a fix anymore. But I can imagine others are... |
@stefanpenner this seems to be an issue for us also. Any word on a fix? Thanks. |
I do not believe that anyone has worked on this yet. A good first start would be to submit a failing test case (we run our test suite against IE9 so submitting a failing test here should show the failure). |
Ok. I haven't dug much into htmlbars before. Any suggested files to look at? |
@rwjblue This is an IE8 specific issue, do tests run against it? |
After digging into this, I'm not really sure what a failing test should look like because I'm not sure what should be tested and changed. My two thoughts are:
I'm not sure which approach is a seems like a better option, or if I'm barking up the completely wrong tree. @rwjblue which direction do you think I should go? I'll try to write a test for that. |
@rwjblue I've been working on this for the last day and a half straight, and I don't think I'm anywhere near a solution or even a idea of what to test for. Some guidance would be very appreciated. |
@mmun - We could use your advice here.... |
After a lot of digging, I have modified By doing this, type becomes a static attribute, it cannot be passed in later. I've quickly found places where type gets set as |
I've been able to reproduce this in IE8 by simply using an input helper with a bound value attribute. @xcskier56 mind sharing your code? I'd like to look into this a bit further and help however possible. |
@eddflrs, I've pushed some really basic code to my fork here here. My basic strategy is to not create any morphs for a type attr. This way we will not have to change the type after it has been appended to a node. But for this to work, when we build the element, we need some sort of knowledge about the environment so that we can correctly set type attributes that are bound. |
@xcskier56 thanks for sharing! I'll have a closer look over the weekend. |
Is anybody close to having a fix or a workaround for this? As far as I can tell all form inputs have been broken in IE8 for a couple months now. A basic |
@rwjblue @xcskier56 I have bandwidth to work on this issue as I need to get IE 8 working for a client project. I am available 8 hours a day starting 8/15. Any pointers regarding where to start? |
@stavarotti I think I actually have a way to solve this. If we are ok limiting the type attr to being set once and only once at first render, then this works. Which is a requirement for this to work with IE8 anyways Basically, the idea is to modify the function that creates the attributes to be added to the component so that the I think that this actually belongs in Ember.js, but I'll describe it here. In Something like this will work
This needs to be placed after the loop through the attribute bindings so that it has the correct information. This way when the manualElement function gets called, attrs['type'] is a string instead of a array and it will then set the attribute on the element before it has a parent node. |
I am currently working on getting tests to pass with more or less what I outlined above. The real question is how should we handle the change in behavior that this will necessitate. In the tests, we expect that we can set the type attr on an input with a dynamic property, and then when this property gets changed after the input is rendered, the input's type should change to the new value. This is exactly the behavior that will error in IE8. I think that including some sort of flag on the input component like @rwjblue How do you think we should handle this change in behavior? |
The test in Ember that confirms |
Would it make sense to just detect IE8 to decide whether it should be a static or dynamic attribute? |
A better way to detect it would be just catching the exception, I think. |
@rwjblue where should I put this so that it is evaluated once? Also, is there a way to optionally make this the default behavior for an app? In our case, we support IE8, therefore I would like to make the way inputs behave in modern browsers the same as in IE8 so that I can catch issues that might arise from different add ons much sooner. |
Yep, don't use a bound property for |
Where should this feature detection code go? Is there a standard place that browser oddities are? |
I was thinking something similar to: https://github.com/emberjs/ember.js/blob/master/packages/ember-views/lib/views/text_field.js#L13-L35 Also, the PR for Ember should target |
@xcskier56 Thanks for doing the leg work. I got pulled into other projects was not able to dedicate the time originally stated. |
Fixed by emberjs/ember.js#12596. |
source: emberjs/ember.js#11553
TL;DR
input.type
must be set before input is appended to any tree(fragment, or body ancestored)The text was updated successfully, but these errors were encountered: