Inputmask does not prevent NUMLOCK or SCROLLLOCK key presses

Created on 29 November 2024, 2 months ago

Problem/Motivation

If you specify an custom input mask on a webform textfield that contains a mixture of alphanumeric characters, when you press Scroll lock or Numlock keys, the keypress is not prevented and instead the text "SCROLLLOCK" or "NUMLOCK" is entered as the value of the field.

For example, a text field for UK national insurance number has a custom input mask of "AA 99 99 99 A":

Normally the input mask will ensure you type only alphanumeric characters in the correct place:

However, if you press Numlock or Scroll lock keys on your keyboard, these will insert as text values overriding the restrictions of the input mask:

Proposed resolution

I think this is a regression in version 5.0.8 of the Inputmask library and has been fixed in version 5.0.9 β€” see https://github.com/RobinHerbots/Inputmask/issues/2720. So the solution is to upgrade the Inputmask library version which Webform uses to version 5.0.9.

πŸ› Bug report
Status

Active

Version

6.2

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom glugmeister

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024