Edit: See this comment for what I believe fixes this issue.
Steps to reproduceUse vue-dev-tools on the vue-material docs. (I can't seem to get the dev tools to activate on vuematerial.io, so I'm using a local copy a la npm run dev
.)
Watch the events and type in an input, textarea or change a select.
Which browser?Latest Vue, git dev version of vue-material, latest stable Chrome
What is expected?I would expect to only receive one input event. In the case of the select, I would expect to receive one event with the value of the selection.
What is actually happening?You'll see two or three events for each key stroke. In case of the select, you'll get one input event with the value of the selection and another with the inner text of the selection.
InvestigationIn the case of MdInput, there's three sources that these events come from. First in listeners()
in MdInput.vue
.
In MdFieldMixin.js
the set(value)
for the computed model
, and the watcher for value
both set localValue
which causes an emit.
I don't know enough about how MdInput is supposed to work to fix it. I did notice that set(value)
for model
checks if value
is an InputEvent
. In all my testing the only thing value
ever is is a String
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4