Describe the bug
Assume we have an input with two dynamic masks: one is an empty string, and the other is a number with some prefix text. When we want to add some digits before an existing number, the cursor is placed incorrectly.
IMask(input, {
mask: [
{
mask: "",
},
{
mask: "$ d",
lazy: false,
expose: true,
blocks: {
d: {
mask: Number,
expose: true,
},
},
},
],
});
To Reproduce
Open https://jsbin.com/voconifaze/edit?html,js,output then click "Run with JS" in the output panel.
Input 111 -> [$ 111|]
Place the cursor at the beginning of the number. -> [$ |111]
Input 2 then 2 -> [$ 211|1] -> [$ 2112|1]
Expected behavior
The value should be [$ 22|111]
Environment:
- OS: macOS
- Browser: Chrome
- Version: 142.0.7444.176
- IMask: 7.6.1
Additional context
Describe the bug
Assume we have an input with two dynamic masks: one is an empty string, and the other is a number with some prefix text. When we want to add some digits before an existing number, the cursor is placed incorrectly.
To Reproduce
Open https://jsbin.com/voconifaze/edit?html,js,output then click "Run with JS" in the output panel.
Input
111->[$ 111|]Place the cursor at the beginning of the number. ->
[$ |111]Input
2then2->[$ 211|1]->[$ 2112|1]Expected behavior
The value should be
[$ 22|111]Environment:
Additional context