Skip to content

Commit

Permalink
Do not fire keybindings in XUL input fields
Browse files Browse the repository at this point in the history
Also, modify the other checks for text inputs to be more likely to work
(though I have only found `textbox` and `input` fields in the
Thunderbird UI so far).
  • Loading branch information
wshanks committed Oct 26, 2019
1 parent 1ab9ee0 commit b217506
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addon/content/tbkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ var TBKeys = {

bindKeys: function(window) {
window.Mousetrap.prototype.stopCallback = function(e, element, _combo) {
let tagName = element.tagName.toLowerCase()
return (
element.tagName == 'textbox' || element.tagName == 'INPUT' ||
element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' ||
tagName == 'textbox' || tagName == 'input' ||
tagName == 'select' || tagName == 'textarea' ||
(element.contentEditable && element.contentEditable == 'true')
)
}
Expand Down

0 comments on commit b217506

Please sign in to comment.