ignore keypress on contenteditable

This commit is contained in:
Ilya Grigorik
2015-11-07 12:27:34 -08:00
parent e405a5cdbb
commit 37e2d32ace

View File

@@ -173,7 +173,9 @@ chrome.extension.sendMessage({}, function(response) {
var keyCode = String.fromCharCode(event.keyCode).toUpperCase().charCodeAt();
// Ignore keypress event if typing in an input box
if (document.activeElement.nodeName === 'INPUT' && document.activeElement.getAttribute('type') === 'text') {
if ((document.activeElement.nodeName === 'INPUT'
&& document.activeElement.getAttribute('type') === 'text')
|| document.activeElement.isContentEditable) {
return false;
}