-
Notifications
You must be signed in to change notification settings - Fork 477
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
Also filter out keypresses when focused on contenteditable elements #45
Comments
The element's key.filter = function(event) {
var el = event.target || event.srcElement;
return !(el.isContentEditable || el.tagName == 'INPUT' ||
el.tagName == 'SELECT' || el.tagName == 'TEXTAREA');
} |
+1 |
Would you accept a pull request for this change, @madrobby? |
👍 is there any reason this has been open for a year and half? I'm happy to PR if that's all it needs. |
@ajb not everyone needs this, that's why the filter function is easily overridable. I'd merge a PR with extensive tests tho. It needs detection of the browser supports |
Thanks -- to your credit, |
@madrobby Awesome library so far. 👍 to add |
I just overrode key.filter() to also ignore keypresses when the current element is contenteditable, using this code:
I'm not sure if that's the best way to implement it, but it seems like this would be a good default, no?
The text was updated successfully, but these errors were encountered: