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

loading-states extension now fails in Safari #2450

Open
RussBaz opened this issue Mar 31, 2024 · 4 comments
Open

loading-states extension now fails in Safari #2450

RussBaz opened this issue Mar 31, 2024 · 4 comments

Comments

@RussBaz
Copy link

RussBaz commented Mar 31, 2024

Hi. loading-states extension stopped working in Safari (I have just updated my macOS to 14.4.1 [Intel] but I can check on M1 as well) but it works correctly in Firefox.

The console indicates that evt.target is null when the following point in code is reached:

htmx.defineExtension('loading-states', {
        onEvent: function (name, evt) {
            if (name === 'htmx:beforeRequest') {
                const container = loadingStateContainer(evt.target);

Which results in [Error] TypeError: null is not an object (evaluating 'e.closest') — htmx.min.js:1:6518 error displayed in the console.

The htmx version I use is 1.9.11.

Can anyone check why this might be happening or give tips on how to troubleshoot it properly?

Thank you.

UPD: It works as expected in safari (17.3.1) for macOS 14.3.1 (M1)

@jozefrebjak
Copy link

The same problem on M1 Pro.

HTMX 1.9.5 and after problem with loading-states I updated to 1.19.11 and problem is still there.

Current Safari 17.4.1.

MacOS Sonoma 14.4.1

Console Log:
CleanShot 2024-04-12 at 11 30 50

@andryyy
Copy link

andryyy commented Apr 12, 2024

Probably needs the same fix as 695fd8a

@jozefrebjak
Copy link

@andryyy Yes you are right. I created a PR #2478

@andryyy
Copy link

andryyy commented Apr 12, 2024

Nice, thank you!

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

3 participants