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

fix: Correctly dispatching the load event on popstate after snippets are restored by Naja #22

Merged
merged 1 commit into from
May 28, 2024

Conversation

zipper
Copy link
Contributor

@zipper zipper commented May 28, 2024

When popstate occurs and snippets are loaded from the snippet cache, we need to manually dispatch the load event. This used to be dispatched immediately after popstate, which resulted in the load event being dispatched before the snippets were actually restored from the cache by Naja. Now we schedule the dispatch after the snippets have been restored using the setTimeout method.

…ets are restored by Naja

When `popstate` occurs and snippets are loaded from the snippet cache, we need to manually dispatch the load event. This used to be dispatched immediately after `popstate`, which resulted in the load event being dispatched before the snippets were actually restored from the cache by Naja. Now we schedule the dispatch after the snippets have been restored using the `setTimeout` method.
@zipper zipper merged commit 00616a9 into master May 28, 2024
1 check passed
@zipper zipper deleted the ajax-modal-load branch May 28, 2024 11:36
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

Successfully merging this pull request may close these issues.

1 participant