Closed ko1ebayev closed 9 months ago
User types the first digit => 1st input
event.
Maskito add placeholder
=> Maskito programatically update textfield' value => 2nd input
event.
It is important to dispatch input
-event for programatic updates of textfield (the such popular frameworks like React and Angular require it to update internal states of their components).
I did not use any framework-specific packages in my example, with plain TS and HTML event fires twice too. You can't catch keypress event, validate it and patch control with masked value?
I did not use any framework-specific packages in my example, with plain TS and HTML event fires twice too. You can't catch keypress event, validate it and patch control with masked value?
We use only beforeinput
& input
events for Maskito.
My mistake, I think i have idea how to remove some excess dispatchings of input
-event
Thank you very much for deciding to work on this case!
@ko1ebayev
This bugfix will be released in Maskito 2.0.0 (the expected release date is the second half of January)
Which package(s) are the source of the bug?
@maskito/core, @maskito/kit
Playground Link
https://stackblitz.com/edit/xd2ihb?file=index.ts&hideExplorer=1
Description
When using date range mask and typing first symbol in input - it emits
InputEvent
twice, check out stackblitz, type for ex.1
in input and check console logs. I guess assigning placeholder firstly and actual1D/MM/YYYY - DD/MM/YYYY
after causing this issue. Can maskito handle this?Maskito version
1.9.0
Which browsers have you used?
Which operating systems have you used?