srm985 / mok-project

Multilingual Onscreen Keyboard Project
http://www.seanmcquay.com/mok-project.htm
MIT License
30 stars 8 forks source link

Characters being typed multiple times when keyboard re-opened multiple times #42

Closed madhuraadawadkar closed 5 years ago

madhuraadawadkar commented 5 years ago

I am using the keyboard popup on a field present on modal window. When I close and open the keyboard popup multiple times, the characters are typed multiple times. Example: If I click on "t" the second time I re-open the keyboard, the characters are typed as "tt", the third time, I open the keyboard, "ttt" is typed.. and so on.

srm985 commented 5 years ago

This is most likely because you are closing the modal, not the keyboard. Am I correct in this assumption? If that's the case, each time you click on an input field which triggers the keyboard, you're triggering another instance which means all of the listeners are being triggered again.

Can you help me understand the use case for loading the keyboard inside a modal?

madhuraadawadkar commented 5 years ago

I was initializing the keyboard on an element present on modal, so it was getting instantiated everytime the modal was closed and opened. I changed it and it is working as expected. Thanks!