Skip to content

IE11 <select @input="..."> not firing on selection change #4701

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

Closed
bhoop opened this issue Jan 12, 2017 · 14 comments
Closed

IE11 <select @input="..."> not firing on selection change #4701

bhoop opened this issue Jan 12, 2017 · 14 comments

Comments

@bhoop
Copy link

bhoop commented Jan 12, 2017

Vue.js version

2.1.8

Reproduction Link

https://fiddle.jshell.net/b9re3psg/

Steps to reproduce

  1. Use Internet Explorer 11:
  2. Change the selection of the <select> field next to "Won't fire" from 2016 to 2017

What is Expected?

The test() method will be called (which fires off an alert()).

What is actually happening?

Nothing (in Internet Explorer 11). In Chrome and Firefox the test() method is triggered as expected.

@yyx990803
Copy link
Member

This actually has nothing to do with Vue, it's simply how IE11 behaves: https://fiddle.jshell.net/b9re3psg/1/

@danieldiekmeier
Copy link

I had to look around for a while to find and solve this issue. Can we add this to the docs? How is it solved with v-model?

@nirazul
Copy link

nirazul commented Mar 21, 2017

I might be missing something, but... what about using change event instead of input? Do you really require input?

@danieldiekmeier
Copy link

@nirazul Yes, that's what I did now. But from the docs about form input components I assumed that v-model is always syntactical sugar for :value / @input. But on <select> elements, this seems to not be the case.

As I said, it's working for me now, I just thought that maybe you can make this more obvious for future people with the same kind of problems.

@znck
Copy link
Member

znck commented Mar 21, 2017

With v2.2+ you can use any event with v-model (checkout model option)

@nirazul
Copy link

nirazul commented Mar 21, 2017

@danieldiekmeier
Your statement is totally correct, v-model is always syntactical sugar for :value / @input.
It's only that IE11 doesn't fire an input event like other browsers do.

@danieldiekmeier
Copy link

@nirazul But using v-model on <select> elements works in IE 10/11! (I tried that yesterday when I was debugging my problem.)

@nirazul
Copy link

nirazul commented Mar 21, 2017

@danieldiekmeier Oh... 👯

@nirazul
Copy link

nirazul commented Mar 21, 2017

@danieldiekmeier
Copy link

But I looked around a bit where this information could be put, but am not sure there actually is a place. Probably it was just my own mistake, because it really has nothing to do with Vue. I'm fine if we just put this to rest now. 💃

@vedmant
Copy link

vedmant commented Sep 4, 2017

Yeah, it's not obvious that @input will not work on IE11 as if v-model is just a syntax sugar for @input (to update value), I think it have to be said in docs that v-model also handles browsers compatibility better.

@campbellwmorgan
Copy link

+1 on this. Coming from a React background where browser quirks like this are handled behind their fixed API this was a particularly frustrating behaviour to come across. I think that a good solution would either/both be:

@isocroft
Copy link

isocroft commented Feb 23, 2018

@bhoop you can try <select @textinput="func">for input events. input event isn't supported in IE 11. However, textinput event is supported.

I'm also thinking we can nicely provide this alternative facade within the VueJS eventing core with the permission of @yyx990803 .

@zifnab87
Copy link

I was able to make it work with v-model.lazy in IE11. According to the documentation this uses change event instead of input.. I couldn't make it fire with @change and :value instead of v-model.. It is not stated anywhere that this would work with IE11. Also keep in mind b-form-select doesn't work with v-model.lazy unfortunately..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants