1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

Add test for event.event.target being undefined in the tm-focus-selector listener (#5771)

This commit is contained in:
Simon Huber 2021-06-14 11:59:31 +02:00 committed by GitHub
parent 960160b3a2
commit f2e26927c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ exports.startup = function() {
$tw.rootWidget.addEventListener("tm-focus-selector",function(event) {
var selector = event.param || "",
element,
doc = event.event ? event.event.target.ownerDocument : document;
doc = event.event && event.event.target ? event.event.target.ownerDocument : document;
try {
element = doc.querySelector(selector);
} catch(e) {