Skip to content
Discussion options

You must be logged in to vote

Chrome 126.0.6478.183 on Mac Sonoma (M2 chipset). I can type any letters.

As far as I know, returning false on keydown (standard event) is not part of any specs so I wouldn't rely on it (Although it used to work everywhere, not sure if it's still the case). What you really want is a dynamic mask

<input
    x-data
    x-mask:dynamic="$input.substr(11,1) == 'K' ? '99.999.999-K' : '99.999.999-9'"
    type="text"
/>

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@ipontt
Comment options

@SimoTod
Comment options

SimoTod Jul 22, 2024
Collaborator

@ipontt
Comment options

@SimoTod
Comment options

SimoTod Jul 23, 2024
Collaborator

Answer selected by ipontt
@ekwoka
Comment options

@SimoTod
Comment options

SimoTod Jul 23, 2024
Collaborator

@ipontt
Comment options

Comment options

You must be logged in to vote
1 reply
@ipontt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants