Bug 1502130 - Prevent handling contentSearchUI events if input element is no longer present r=ursula,k88hudson

Differential Revision: https://phabricator.services.mozilla.com/D9828
This commit is contained in:
Andrei Oprea
2018-10-26 15:12:25 +00:00
parent e12de2a2ac
commit 1e240d98d3

View File

@@ -223,6 +223,11 @@ ContentSearchUIController.prototype = {
},
handleEvent(event) {
// The event handler is triggered by external events while the search
// element may no longer be present
if (!document.contains(this.input)) {
return;
}
this["_on" + event.type[0].toUpperCase() + event.type.substr(1)](event);
},