[bug] input-mask does not treat my regex as I would expect
Here is my codesandbox where I tried some experiments.
I just wanted to see if I can make the input accept any number between 0 and 255 and block the user's input whenever they're typing something that would result in an invalid value.
As you can see in the codesandbox, I've tried 3 different ways and they all fail to behave as desired in their own unique ways.
The issue here is that regex inside arrays are atomic, so they are removed if they do not match, which is the default behavior for input masks.
I would suggest a function mask style instead of regex/string array. It's currently a bit early here, but give me a few hours and I can provide an example.
There is an issue: how should input mask behave if you edit inside the string, e.g. "127.0.0" is there and you move to the start of the second number and enter "192" before it, thus pushing the 0 beyond the boundary of the following dot. Should the number be moved out of the current number into the following one or removed?
I think the use case is more complex than it seems.