Keyboard icon indicating copy to clipboard operation
Keyboard copied to clipboard

Numeric keyboard issue?

Open luncan987 opened this issue 4 years ago • 2 comments

First thank you for the awesome keyboard project, and it still being maintained!

Iam not sure about this "issue" but I really would like to hear your opinion @Mottie

I created a layout is based of custom numbers. as it can be seen on the following code: const kb = { caretToEnd: true, layout: 'custom_float', restrictInput: true, preventPaste: true, stayOpen: true, display: { cancel, accept, clear: ${trashIcon}, }, customLayout: { default: [ '7 {sp:25px} 8 {sp:25px} 9 {sp:100px} {b}', '4 {sp:25px} 5 {sp:25px} 6 {sp:135px} {clear}', '1 {sp:25px} 2 {sp:25px} 3 {sp:100px} {c}', '- {sp:25px} 0 {sp:170px} {a}', ], }, };

when the keyboard shown, the "dash" key, can be entered multiple times. Shouldnt be blocked, "somehow" ? Because when I see the demo on https://mottie.github.io/Keyboard/ it have the same issue on numeric keyboard.

luncan987 avatar Feb 04 '22 13:02 luncan987

Hi @luncan987!

You can control what is added into the input using the beforeInsert function

Mottie avatar Feb 05 '22 04:02 Mottie

Yes, I already tried to use the function, beforeInsert, but I guess I have to write somekind of regex to "enable" only single dash. Is there any other way to solve it?

luncan987 avatar Feb 07 '22 06:02 luncan987