Mottie / Keyboard

Virtual Keyboard using jQuery ~

Home Page:http://mottie.github.io/Keyboard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blocks otherwise working `keyup` events, when using `$(document).on()`

matths opened this issue · comments

I can't find the time to build a simple example, but in a complex ecommerce project I'm working on, the mottie on screen keyboard disables keyup event listeners directly set using $(document).on(). Even keyup events using the physical keyboard doesn't trigger my event listener anymore.

I consider this is a serious problem, cause obviously the main advantage of $(document).on() is, that it also applies for elements that were dynamically applied, e.g. after loading stuff by Ajax or fetch.

  $('#my_input').keyup(function () {
    console.log('UP1'); // working
  });

  $(document).on('keyup', '#my_input', function () {
    console.log('UP2'); // not working
  });

$('input:not(:checkbox, :radio)').keyboard({ ....});

Did someone else find a solution around this?