fix: prevent modal closing on inner clicks#685
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
So, the particular code that is causing this is a hack to add light dismiss to Safari (see #522 for context). I suggest that we feature check You can feature check typeof HTMLDialogElement !== "undefined" &&
typeof HTMLDialogElement.prototype === "object" &&
"closedBy" in HTMLDialogElement.prototypeFeel free to simply that to the final condition if this code will only run in a browser. I said this in #522, but I do think it could be worth removing the hack entirely if it’s causing issues or not working correctly. Users can already dismiss the modal using the Escape key or with the dismiss button; light dismiss is a progressive enhancement. This is likely a better route than keeping it as light dismiss is not easy to implement with |
|
yes, I think that's a better fix - thank you 🙏 |
Co-authored-by: Daniel Roe <daniel@roe.dev>
Summary
Rationale
Changes
Test Plan
Fixes #667