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: Better detection of initial state #21

Merged
merged 1 commit into from
May 28, 2024
Merged

fix: Better detection of initial state #21

merged 1 commit into from
May 28, 2024

Conversation

zipper
Copy link
Contributor

@zipper zipper commented May 28, 2024

The pdModal is not stored in the state if it is the initial state created in Naja's replaceInitialState. After the Naja update to 2.6.0 it is easier to detect the initial state and prevent the pdModal from being saved in it. This is especially helpful when a non-ajax modal is opened and then navigated. Previously, this was incorrectly detected as a PdModal state because PdModal was already open. Now, in this case, the state correctly contains no pdModal, as the non-ajax modal should never appear in the history (and if it does, it shouldn't be handled by the AjaxModalExtension anyway).

The pdModal is not stored in the state if it is the initial state created in Naja's `replaceInitialState`. After the Naja update to 2.6.0 it is easier to detect the initial state and prevent the `pdModal` from being saved in it. This is especially helpful when a non-ajax modal is opened and then navigated. Previously, this was incorrectly detected as a PdModal state because PdModal was already open. Now, in this case, the state correctly contains no `pdModal`, as the non-ajax modal should never appear in the history (and if it does, it shouldn't be handled by the `AjaxModalExtension` anyway).
@zipper zipper merged commit 54db251 into master May 28, 2024
1 check passed
@zipper zipper deleted the ajax-modal branch May 28, 2024 11:17
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