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

visible method not invoked if usePreview: false #432

Closed
traumatic opened this issue Feb 4, 2016 · 4 comments
Closed

visible method not invoked if usePreview: false #432

traumatic opened this issue Feb 4, 2016 · 4 comments

Comments

@traumatic
Copy link

Hi,

Based on Mottie's example I introduced
usePreview: false
which leads to the method visible not being executed. See here. I would have expected that once the keyboard is shown, keys like space, accept, etc. are disabled.

Why does usePreview has an influence on the visible method?

@Mottie
Copy link
Owner

Mottie commented Feb 4, 2016

Hi @traumatic!

Hmm, thanks for reporting this problem... it looks like bug in that when usePreview is false, the callback bindings are removed because of name-spacing. I'll have that patch available in the master branch here shortly.

Alternatively, binding to the visible event would have worked either way (demo)

$('#keyboard')
  .on('visible change', function(e, keyboard) {
    // do something
  })
  .keyboard({
    usePreview: false
  });

@traumatic
Copy link
Author

Thanks for the demo Mottie. But in this demo toggling the keys from disable to enable mode don't seem to work any more ...

@Mottie
Copy link
Owner

Mottie commented Feb 4, 2016

Oh, sorry... I should have bound to "keyboardChange" which is an event that is fired with any change to the content versus "change" which is only fired, on the original element, when the content has been accepted or canceled (docs & demo).

$('#keyboard')
  .on('visible keyboardChange', function(e, keyboard) {
    // do something
  })
  .keyboard({
    usePreview: false
  });

@traumatic
Copy link
Author

No worries Mottie. Could realised myself. Thanks for your help!

@Mottie Mottie removed the Next Update label Feb 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants