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(web): consistent modal escape behavior #7677

Merged
merged 2 commits into from Mar 7, 2024

Conversation

michelheusschen
Copy link
Contributor

The escape key inconsistently closes modals, sometimes doing nothing and other times closing the modal and navigating to the previous page.

To address this the FullscreenModal exposes a callback that combines the clickOutside and onEscape events. The clickOutside action has been modified (in a backwards compatible way) to accept callback functions. Using a callback function for onEscape prevents the escape key from propagating and navigating to previous pages.

Not all changes are related to this issue, some refactoring is included. I've manually tested all instances where FullScreenModal was used and some of ConfirmDialogue

Copy link

cloudflare-pages bot commented Mar 6, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7a2d680
Status: ✅  Deploy successful!
Preview URL: https://7e8af40b.immich.pages.dev
Branch Preview URL: https://fix-web-consistent-modal-esc.immich.pages.dev

View logs

Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jrasm91 jrasm91 merged commit 5dd11ca into main Mar 7, 2024
25 checks passed
@jrasm91 jrasm91 deleted the fix/web-consistent-modal-escape branch March 7, 2024 03:18
aviv926 pushed a commit to aviv926/immich that referenced this pull request Mar 7, 2024
* fix(web): consistent modal escape behavior

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

Successfully merging this pull request may close these issues.

None yet

3 participants