Safari + CustomEvent target and srcElement are null causing TypeError: null is not an object (evaluating 'evt.srcElement.getAttribute') on yoyo.js:51 #27
Closed
shaynekasai
started this conversation in
Bugs
Replies: 1 comment 2 replies
-
@shaynekasai I see the error on the demo, but not on a local version of the app even though the local app doesn't work because the request URLs are wrong. I was able to get the local app working by replacing if (name === 'htmx:configRequest') {
if (!evt.target) return
Yoyo.bootstrapRequest(evt)
} And bootstrapRequest(evt) {
const elt = evt.target
...
} I would also need to spend more time testing a more complex app I have to see if there are any issues without and with the patch. Do you have any examples of components where you get an error, other than on the demo app? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There seems to be a recent issue in Safari causing CustomEvent to not include target and srcElement, we noticed this in afterProcessNode, you can see the error when you load up the Yoyo demo site. This causes our app not not function at all in Safari.
Version of Safari is 17.4.1
OS: MacOS Sonoma 14.4.1
Our current workaround will likely be a patch to coerce .target and .srcElement from .detail.elt in Safari but we're still trying to brainstorm around this. The bug may also be eminating from htmx
Beta Was this translation helpful? Give feedback.
All reactions