Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
matths opened this issue Nov 16, 2020 · 0 comments
Open

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

matths opened this issue Nov 16, 2020 · 0 comments

Comments

@matths
Copy link

matths commented Nov 16, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant