Mottie / Keyboard

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

Keyboard accept time hidden.bs.modal event run #566

Closed muradsofiyev closed 7 years ago

muradsofiyev commented 7 years ago

When I'm accepted keyboard resets all input

Mottie commented 7 years ago

Hi @muradsofiyev!

Would you please modify this demo to show the problem being described?

muradsofiyev commented 7 years ago

Hey i find problem http://jsfiddle.net/u5kuwxuk/ watch this example your plugin call my modal hidden event

Mottie commented 7 years ago

I still don't understand the issue. Please describe the problem, and what steps are needed to perform to reproduce it.

ketterus commented 7 years ago

You need to give your

muradsofiyev commented 7 years ago

When i accepted keyboard keyboard close but my modal close event listener (hidden.bs.modal) run You see that open your console http://jsfiddle.net/u5kuwxuk/ this example and accept keyboard

Mottie commented 7 years ago

Ok, I understand now... sorry it took me so long to respond.

The problem is that the keyboard triggers a hidden event when it hides, and Bootstrap triggers a hidden.bs.modal to show that the modal was hidden.

You can solve this issue in two ways:

  1. Change the keyboard event that is triggered when it is hidden (docs):

      $.keyboard.events.kbHidden = "keyboardHidden";
  2. Because jQuery uses namespacing, any characters after the first period in the event will be added as a namespace. Therefore, check the namespace of the event before executing any code (demo):

    $("#myModal").on('hidden.bs.modal', function(event) {
      if (event.namespace === 'bs.modal') {
        console.log('hello world');
      }
    });
Mottie commented 7 years ago

I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue the discussion in this thread.