ngx-intl-tel-input
ngx-intl-tel-input copied to clipboard
Paste keyboard shortcuts do not work on Safari on Mac OS
Using paste keyboard shortcut does not work when using Safari on Mac OS.
The issue is due to the checks in onInputKeyPress(event: KeyboardEvent)
. This function allows characters such as c
and v
along with Ctrl
key. However on Mac when using the command key the key.ctrlKey
is false and so the check fails. the key.metaKey
is true but is not used here. This issue does not exist in Chrome or Firefox on MacOs because pasting does not invoke the keypress
event on those browser but it does on Safari.
The ideal fix would be to allow the Command key along with the Ctrl Key. essentially changing the check from
!(event.ctrlKey && allowedCtrlChars.test(event.key))
to
!((event.ctrlKey || event.metaKey) && allowedCtrlChars.test(event.key))
I've got the same problem, when this will get fixed?