hawkgs/jqKeyboard

Keyboard only works with elements created before calling init function

avallcanera opened this issue · 2 comments

Hi! Thanks for your excellent work, I love your plugin :)
I found an issue: the keyboard only works with elements created before calling init function. If you create a new input dinamically (for example inside a modal box) the keyboard doesn't works.
You should change the following code (jqkeyboard.js, line 433):
<========
$(allowedElements).focus(function () {
EventManager.$activeElement = $(this);
});
========>
$(document).on('focus',allowedElements,function () {
EventManager.$activeElement = $(this);
});
This fix the problem.
Thanks again!

All the best,
Alejandro Vallcanera

Thanks for submitting the issue. I'll take a look at it 🙂

By the way, feel free to submit PRs for that matter.