You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open JsFiddle in native IE9 (neither IE10, nor IE11 in compatibility mode will produce this error).
Klick get value => As you can see, the values of both radio buttons are read properly (first, second).
Klicking on "mount vue" and afterwards "get value" will return "on" for both radios.
What is Expected?
After mounting Vue the radio value should still be "first" and "second" in Internet Explorer 9.
What is actually happening?
I do not exactly now what Vue does when mounting an element, but it seems that the element is somehow processsed which leads to this IE error.
I've found the following StackOverflow entry: http://stackoverflow.com/a/13288980
It states if an radio element is created by JavaScript and the value is set BEFORE the type is set to "radio", IE will return the default value "on" instead the given value.
In my application I'm not able to tell which radio button was selected when submitting the form with jQuery AJAX Post request, as both inputs will send "on".
It would be great if someone with more Vue insights has some idea what could causing this issue.
I'm aware that in my example Vue itself is not needed at all, but I tried to create the most minimalistic code as possible which is able to reproduce the issue. In real live this is part of a website where the radio buttons are inside a container which is mounted in Vue. On another place jQuery reads the selected radio button value which works in all browser but IE9.
Kind regards and many thanks in advance
Andreas
The text was updated successfully, but these errors were encountered:
here is a short update after digging deeper and deeper into Vue.js:
Calling invokeCreateHooks AGAIN after the new element is created seems to fix the problem, i.e. (about line 4015 in 2.1.4):
if (isDef(data)) {
invokeCreateHooks(vnode, insertedVnodeQueue);
}
insert(parentElm, vnode.elm, refElm);
// call invoieCreateHooks again as the values need to be applyied AFTER the element has been created (IE9 would discard the value as the element is not of type radio yet)
if (isDef(data)) {
invokeCreateHooks(vnode, insertedVnodeQueue);
}
Leaving the first invokeCreateHook out did not work for me!
For know I think this issue is exatly related to the issue posted on Stack Overflow.
There is a new elemente created (which defaults to a input type text). The value is applied BEFORE the type is changed to radio and therefore IE9 does not get the correct value on the newly created element which defaults to "on".
Vue.js version
2.1.4
Reproduction Link
https://jsfiddle.net/86m9vwad/11/
Steps to reproduce
Open JsFiddle in native IE9 (neither IE10, nor IE11 in compatibility mode will produce this error).
Klick get value => As you can see, the values of both radio buttons are read properly (first, second).
Klicking on "mount vue" and afterwards "get value" will return "on" for both radios.
What is Expected?
After mounting Vue the radio value should still be "first" and "second" in Internet Explorer 9.
What is actually happening?
I do not exactly now what Vue does when mounting an element, but it seems that the element is somehow processsed which leads to this IE error.
I've found the following StackOverflow entry: http://stackoverflow.com/a/13288980
It states if an radio element is created by JavaScript and the value is set BEFORE the type is set to "radio", IE will return the default value "on" instead the given value.
In my application I'm not able to tell which radio button was selected when submitting the form with jQuery AJAX Post request, as both inputs will send "on".
It would be great if someone with more Vue insights has some idea what could causing this issue.
I'm aware that in my example Vue itself is not needed at all, but I tried to create the most minimalistic code as possible which is able to reproduce the issue. In real live this is part of a website where the radio buttons are inside a container which is mounted in Vue. On another place jQuery reads the selected radio button value which works in all browser but IE9.
Kind regards and many thanks in advance
Andreas
The text was updated successfully, but these errors were encountered: