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

Ask before navigating away from composer #7240

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KevSlashNull
Copy link
Contributor

This makes the Discard draft? post show up if you click on a link within the composer.

That fixes a bug where you write a reply to a post and then lose the reply by clicking on the avatar of the person who you’re responding to. You would not be prompted whether you want to discard your draft like when clicking on Cancel. This bug also applies to hovering over the avatar and clicking on one of the links there, which this fixes too.

This is done by introducing a ComposerContext that provides an async function that resolves if the user decided to discard the draft and navigation was thus allowed.

Videos

Situation Before After
Clicking on avatar https://github.com/user-attachments/assets/a902baf9-c9cb-4af6-a417-99fe600a1686 https://github.com/user-attachments/assets/b7bc3057-2deb-427a-a93d-d7dff86c17db
Clicking on card https://github.com/user-attachments/assets/b47afa4c-c5e1-4430-aa37-c3e78aba101c https://github.com/user-attachments/assets/2da47587-4557-4284-b790-915d5c843f5c

This makes the 'Discard draft?' post show up if you click on a link
within the composer.

That fixes a bug where you write a reply to a post and then lose the
reply by clicking on the avatar of the person who you’re responding to.
You would not be prompted whether you want to discard your draft like
when clicking on **Cancel**. This bug also applies to hovering over the
avatar and clicking on one of the links there.
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