Skip to content

Conversation

torresga
Copy link
Contributor

@torresga torresga commented Nov 7, 2024

Jira Ticket

https://ombulabs.atlassian.net/browse/DT-340

Motivation / Context

Currently if you leave the current page, you can lose information that was not saved. This feature warns you if you are leaving without saving information.

QA / Testing Instructions

  1. Go to the Edit Story page.
  2. Edit the story.
  3. Try to navigate off the page by reloading, pressing the back button in the browser, clicking the logo or the Back button on the page.
  4. Ensure that you get a popup asking you if are sure you want to reload/go back.

Screenshots:

Screenshot 2024-11-07 at 1 53 28 PM

I will abide by the code of conduct.

…e form existed. Also created a function to add and remove the beforeunload event listener
@torresga torresga marked this pull request as ready for review November 7, 2024 20:30
Copy link
Member

@JuanVqz JuanVqz left a comment

Choose a reason for hiding this comment

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

My suggestions are not a blocker.

@torresga torresga requested a review from JuanVqz September 6, 2025 00:05
@JuanVqz
Copy link
Member

JuanVqz commented Sep 16, 2025

Hey @torresga, this looks good; however, maybe we can improve a little bit on the isDirty logic; for example, I tried the following, and the state was still dirty when it probably should not have been.

  1. Go to the edit page.
  2. Type 3 letters in the title.
  3. Click back, the logo, or any action that triggers the modal to alert us we left unsaved changes.
  4. The alert will pop up as expected; until here, all looks good.
  5. Then I removed the 3 letters to be in an unchanged state, and clicking any action to get out of the page does not allow me because it says I have unsaved changes when I really don't.

If you need help to follow the described steps, let me know, and we can check it together.

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