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
When using the v-maska directive, the inputevent is triggered twice, this is a huge problem for Ajax requests that listen to input to do something, it'll do twice the request.
A workaround for that is conditionally emit the update:modelValue when event.isTrusted, this introduces another issue if you're using automated test tools like Cypress, because Cypress typing will always be false for event.isTrusted.
Also, it's a guess, but I think some extensions for auto-fill password like Bitwarden or Kaspersky Password Manager seems to be intercepting the type event, which leads to isTrustedfalse, so the workaround above isn't good in some scenarios:
When you disable a button waiting for the input to be filled, if you conditionally trigger the input event when event.isTrusted is true, the button will always be disabled (this is the same scenario when using Cypress).
Steps to reproduce
Bind a input event to a input element
Add a v-maska directive
Every time you type something, it'll trigger twice the input event
Describe the bug
When using the
v-maska
directive, theinput
event is triggered twice, this is a huge problem for Ajax requests that listen to input to do something, it'll do twice the request.A workaround for that is conditionally emit the
update:modelValue
whenevent.isTrusted
, this introduces another issue if you're using automated test tools like Cypress, because Cypress typing will always befalse
forevent.isTrusted
.Also, it's a guess, but I think some extensions for auto-fill password like Bitwarden or Kaspersky Password Manager seems to be intercepting the type event, which leads to
isTrusted
false
, so the workaround above isn't good in some scenarios:input
event whenevent.isTrusted
istrue
, the button will always be disabled (this is the same scenario when using Cypress).Steps to reproduce
input
eventReproduction link
See the console output after typing.
https://codepen.io/JoaoHamerski-the-lessful/pen/qBeMmrw
Related
#168
The text was updated successfully, but these errors were encountered: