Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthetic touch event dispatched before document is loaded #286

Open
hobinjk-ptc opened this issue Feb 23, 2021 · 0 comments
Open

Synthetic touch event dispatched before document is loaded #286

hobinjk-ptc opened this issue Feb 23, 2021 · 0 comments

Comments

@hobinjk-ptc
Copy link
Contributor

libraries/objectDefaultFiles/object.js line 373 elt is undefined.

Current fix I have for this is

diff --git a/libraries/objectDefaultFiles/object.js b/libraries/objectDefaultFiles/object.js
index f5ff01b..fd28643 100755
--- a/libraries/objectDefaultFiles/object.js
+++ b/libraries/objectDefaultFiles/object.js
@@ -372,6 +372,14 @@
             // if it wasn't unaccepted, dispatch a touch event into the page contents
             var elt = document.elementFromPoint(eventData.x, eventData.y) || document.body;

+            if (!elt) {
+                console.warn('this is broken', document);
+                elt = {
+                    dispatchEvent: function() {
+                    },
+                };
+            }
+
             function forElementAndParentsRecursively(elt, callback) {
                 callback(elt);
                 if (elt.parentNode && elt.parentNode.tagName !== 'HTML' && elt.parentNode !== document) {

which drops this early event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant