[Question] How to custom placeholder in "ip" alias?
KiddoV opened this issue · comments
I am trying to make the place holder look like this "___.___.___.___"
, but no matter what I do, it's still showing "_._._._"
.
Is anyone know how to fix that?
import Inputmask from 'inputmask';
const ipv4Inputs = document.querySelectorAll("input[type='ipv4']");
ipv4Inputs.forEach((input: HTMLInputElement) => {
Inputmask({alias: "ip", greedy: false, placeholder: "___.___.___.___", clearIncomplete: true}).mask(input);
});
I have tried placeholder: "___.___.___.___"
, but it doesn't work.
Thanks,
Have you tried with greedy: true?
Thanks, it works, but the behavior is not what I expected. When you type a 2 digit number like "99", it doesn't automatically jump to the next IP section anymore:
99_.___.___.___
You have to type 99
then space
. Without greedy
, it would automatically jump to the next section if you type a number that bigger than 255
, so when I type 99999999
without space it would mask 99.99.99.99
. Now, it just stop when I keep type 9
.
@KiddoV ,
Hmm yes, that would be a good enhancement. 999 is an impossible value so it should jump to the next section.
In the meantime, is there any work around for this you can suggest?
It is fixed in version 5.0.9-beta.35
Correction, almost fixed, .... I just discovered an issue. Anyway you can already have look on the demo page.
Thanks for the update!
It is fixed in version 5.0.9-beta.36