Skip to content

Conversation

charliepark
Copy link
Contributor

@charliepark charliepark commented Jul 17, 2024

This adds a modal for the SideModalForm that protects it from getting accidentally closed when the form is dirty.

I had experimented with a more involved approach, using useBlocker, but as Crespo and I were talking through it, he noted that side modal forms don't always require a route change, so this is possibly both more reliable and simpler.

The deeper question: is the benefit of adding this bit of friction worth it? I'm leaning towards "yes", as the friction is pretty minimal and the potential for data loss is … low-to-moderate? … but am open to alternate takes.

Fixes #2186

Copy link

vercel bot commented Jul 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Nov 19, 2024 6:03pm

@david-crespo
Copy link
Collaborator

This is great. Modal on top of modal is a little funny, but I can live with it, the QoL improvement is huge.

Text is a little tight when there's only one line. Like a McDonald's hamburger, super thin patty. @benjaminleonard ?

image

@david-crespo
Copy link
Collaborator

Before/after on overlay fix. Note how in the before, the background gets double-dark when the confirm modal opens.

2024-11-19-modal-hide-overlay.mp4

@david-crespo david-crespo merged commit 6fe6936 into main Nov 19, 2024
8 checks passed
@david-crespo david-crespo deleted the simplerFormNavGuard branch November 19, 2024 18:40
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.

Use useBlocker to confirm closing side modal form
2 participants