Mottie / Keyboard

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

Cannot read property '$el' of undefined #803

Closed pilz97 closed 3 years ago

pilz97 commented 3 years ago

Hi,

first of all thank you for the awesome keyboard. I am using it in our angular application.

I have a problem on closing the keyboard. When i click outside the input and outside the keyboard, so that the input loses the focus everything is ok and the keyboard closes. But when i click anywhere inside the keyboard where no button is placed (for example the red marked area in the screenshot) a error is fired (Cannot read property '$el' of undefined).

image

Has anyone an idea what could cause the issue? As I mentioned before I am using it in an angular app. I use a directive for creating the keyboard and after that i use popper js for positioning.

Here the position in code where the error is thrown. image

pilz97 commented 3 years ago

I just found the reason.

In my directive i hav a hostlistener for the focusout event, when the event is fired i call keyboard.accept(), which is causing the problem.