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

Differential Revision: https://phabricator.services.mozilla.com/D9828

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrei Oprea 2018-10-26 15:12:25 +00:00
Родитель c9979fa9b6
Коммит f2287575eb
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -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);
},