ngx-intl-tel-input icon indicating copy to clipboard operation
ngx-intl-tel-input copied to clipboard

Paste keyboard shortcuts do not work on Safari on Mac OS

Open abbasgalen opened this issue 2 years ago • 1 comments

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))

abbasgalen avatar Jan 12 '23 20:01 abbasgalen

I've got the same problem, when this will get fixed?

PT-WP avatar Dec 22 '23 11:12 PT-WP