Mottie / Keyboard

Virtual Keyboard using jQuery ~

Home Page:http://mottie.github.io/Keyboard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Numeric keyboard issue?

luncan987 opened this issue · 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.

Hi @luncan987!

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

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?