RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.39k stars 2.17k forks source link

If I use date_time alias with mask "HH:MM" I get "d_tetime" placeholder #2666

Closed giacomomasseron closed 1 year ago

giacomomasseron commented 1 year ago

Hi,
If I use this code:

Inputmask({alias: "datetime", inputFormat: "HH:MM"}).mask(document.querySelectorAll('.inputmask-time'));

I get an input with value and placeholder set to the string "d_tetime" and I can not write on the input.

RobinHerbots commented 1 year ago

Can you give some more context. WHich files did you reference/import?

giacomomasseron commented 1 year ago

Sure.
I installed the package with npm, and I import it with this code:

import inputmask from "inputmask/lib/inputmask";

RobinHerbots commented 1 year ago

Try to import like

import inputmask from "inputmask";

giacomomasseron commented 1 year ago

Same behaviour.

I noticed the problem occurs when the mouse goes over the input masked.
Before that, the input does have "HH:mm" as placeholder. As soon as I go with mouse over the input, the placeholder changes to "d_te_time"

RobinHerbots commented 1 year ago

Hmm, can you create an example on codepen or another platform.

giacomomasseron commented 1 year ago

I solved.
I effectively (I thought I was using it but it wasn't true) used this:

import inputmask from "inputmask";

and it works. Thanks for the help, I close the issue.