sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
78.39k stars 4.1k forks source link

Odd behavior when using Actions with bind inputs #1578

Closed kazzkiq closed 5 years ago

kazzkiq commented 6 years ago

I'm trying to use Actions (<element use:method>) for input formatting (mask), but for some reason it shows odd behavior on special circumstances.

I've tried two approaches. One using .addEventListener() to said input, and other using .set() to data from inside the Action. Both didn't work properly.

Here are two REPLs showing the odd behavior on both cases:

.addEventListener(): https://svelte.technology/repl?version=2.9.1&gist=a08e29c1548586929f4d78ad3d7fde02

.set(): https://svelte.technology/repl?version=2.9.1&gist=3469481210a03bf06a8fbef32c5f325f

Conduitry commented 5 years ago

Closing this in favor of #2446, which is more specific about what's going on here.