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

Simpler nav guard for SideModalForm #2328

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

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 Jul 24, 2024 3:15pm

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
1 participant