M
M
Mikhail2019-07-16 15:49:41
Vue.js
Mikhail, 2019-07-16 15:49:41

Why does VueJS have different behavior in FireFox and Chrome with v-on:paste?

https://jsfiddle.net/AkDF_/m5u2ardy/10/

when pasting text into a field in Firefox, the second alert outputs the copied value, while in Chrome it returns undefined.
and with setTimeout in both browsers, the copied value is displayed.
is this the only way to get a value from a field in chrome? or am I doing something wrong?

UPD
has a method event.clipboardData.getData('text'), but it only returns the copied value. and if something is already entered in the field and it is copied there, then this results in incorrect data.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Suha, 2019-07-16
@andreysuha

e.text try

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question