Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numeric keyboard issue? #814

Open
luncan987 opened this issue Feb 4, 2022 · 2 comments
Open

Numeric keyboard issue? #814

luncan987 opened this issue Feb 4, 2022 · 2 comments

Comments

@luncan987
Copy link

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.

@Mottie
Copy link
Owner

Mottie commented Feb 5, 2022

Hi @luncan987!

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

@luncan987
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants