Skip to content

MBS-14271: Add form unload hook to event/genre forms #3727

Open
reosarevok wants to merge 2 commits intometabrainz:masterfrom
reosarevok:MBS-14271
Open

MBS-14271: Add form unload hook to event/genre forms #3727
reosarevok wants to merge 2 commits intometabrainz:masterfrom
reosarevok:MBS-14271

Conversation

@reosarevok
Copy link
Member

Implement MBS-14271

Problem

Currently users can close the event and genre React forms with no warning even if there are pending changes.

Solution

This cherry-picks the useFormUnloadWarning hook I'm adding during the recording conversion (#3378) to already prevent leaving without warning in our existing React entity forms, event and genre.

AI usage

None

Testing

Manually, by ensuring the forms still close without warning if no changes have been made, then making changes in the forms and making sure they do ask when I try to close them. Keep in mind this only works after the input has been marked as changed, which means for something like the name it only warns after the field has been blurred (if the only change is the name and you ctrl+w while still on the name field, it won't trigger). It still seems much better than nothing though.

These are currently not warning the user if they try
to close the page with pending changes.
This just uses the useFormUnloadWarning hook to warn the user when
relevant.
@reosarevok reosarevok added the QoL Non-urgent quality of life improvements label Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QoL Non-urgent quality of life improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant