Mottie / Keyboard

Virtual Keyboard using jQuery ~
http://mottie.github.io/Keyboard/
Other
1.78k stars 723 forks source link

Backspace does not work in preview element after calling .close() or .accept() #565

Closed KCMertens closed 7 years ago

KCMertens commented 7 years ago

When calling accept() or close() to hide the keyboard, base.$preview is cleared here. However, the keydown event on $preview remains bound, and escape appears to be manually handled, eventually the modified text in the internal buffer is copied out to $preview. However since preview has been cleared, the backspace key is swallowed.

Mottie commented 7 years ago

Hi @KCMertens!

Would you please modify this demo to show this issue. I was not able to duplicate the issue with some basic settings (including setting alwaysOpen to true), so it might be related to your specific settings. Thanks!

KCMertens commented 7 years ago

Hey Mottie!

Sorry for not getting back to you quicker, I didn't have access to the code in question at home yesterday.

We're using the keyboard to support simple input of special characters from other languages, so display of the keyboard is explicitly toggled through a button. We're using the reveal() and accept() fuctions to do this. After opening and closing once, the issue occurs while the keyboard is closed.

I've modified the fiddle to show a minimal repro case by emulating an open and closing of the keyboard. Type something in the field, then press backspace and observe it being swallowed.

Mottie commented 7 years ago

Thanks for the demo, that really helps!

I'll take a look at it later today.