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

Prevent page from closing when pressing back in task detail panel #3935

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

benpbo
Copy link
Contributor

@benpbo benpbo commented Jan 26, 2025

Description

Prevents page from changing or app from closing upon pressing the back button (in android or with a mouse). This is done by using window.history to keep the panel as another history state. When the panel is destroyed, the history entry is deleted. And when going back in history is attempted, the panel closes itself.

Issues Resolved

#3607

Check List

  • New functionality includes testing.
  • New functionality has been documented in the README if applicable.

Use `window.history` to keep the panel as another history state.
When the panel is destroyed the history entry is deleted.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello there benpbo! 👋

Thank you and congrats 🎉 for opening your first PR on this project! ✨ 💖

We will try to review it soon!

@johannesjo
Copy link
Owner

Looks promising! What is missing for the PR to leave the WIP status?

@benpbo
Copy link
Contributor Author

benpbo commented Jan 28, 2025

Mostly not sure if there are any tests that should be added, this code does accomplish the functionality at least as I tested it on my computer and Android Studio.

Also, not sure if the use of window.history is correct, I don't have previous experience with Angular and I see that Router is usually used to "push" history (although it does require a URL and not any object)
See angular/angular#28954 (comment)

Anyway I don't think there is a need to keep it as WIP anymore.

@benpbo benpbo marked this pull request as ready for review January 28, 2025 19:04
@johannesjo
Copy link
Owner

Thank you! I think it works really nicely! I am very happy about the new behavior!

@johannesjo johannesjo merged commit 66790a4 into johannesjo:master Jan 31, 2025
2 checks passed
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.

2 participants