-
Notifications
You must be signed in to change notification settings - Fork 14
Fix image upload modal cancel loop #1755
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license-eye has totally checked 620 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
567 | 1 | 52 | 0 |
Click to see the invalid file list
- app/forms/modal-loop.tsx
app/forms/modal-loop.tsx
Outdated
@@ -0,0 +1,30 @@ | |||
import { useState } from 'react' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { useState } from 'react' | |
/* | |
* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, you can obtain one at https://mozilla.org/MPL/2.0/. | |
* | |
* Copyright Oxide Computer Company | |
*/ | |
import { useState } from 'react' |
I need a break from Safari failing my E2Es before I throw my computer out the window. But I will fix it. |
…h a BABY about it
oxidecomputer/console@bfb680e...af6536d * [af6536d5](oxidecomputer/console@af6536d5) skip one flaky test in safari ugh * [84b5177b](oxidecomputer/console@84b5177b) Add full commit range to omicron PR body (oxidecomputer/console#1759) * [26737fd8](oxidecomputer/console@26737fd8) bump pinned omicron to latest * [81e38209](oxidecomputer/console@81e38209) Tweak playwright config (oxidecomputer/console#1758) * [6582b247](oxidecomputer/console@6582b247) increase timeout for image upload error check * [e2147840](oxidecomputer/console@e2147840) Revert mistake commit "curious what it does when we don't say anything" * [7530c3da](oxidecomputer/console@7530c3da) curious what it does when we don't say anything * [bb436357](oxidecomputer/console@bb436357) Fix image upload modal cancel loop (oxidecomputer/console#1755) * [e1558785](oxidecomputer/console@e1558785) add lint-fast npm script * [4614fe6f](oxidecomputer/console@4614fe6f) Fix oxidecomputer/console#1652 - Listbox popover does not move when page scrolls (oxidecomputer/console#1747) * [14685b11](oxidecomputer/console@14685b11) Upgrade playwright eslint plugin to get new rules (oxidecomputer/console#1752) * [2b3d519d](oxidecomputer/console@2b3d519d) Add loading state to ok button in confirm delete modal (oxidecomputer/console#1750) * [0895081b](oxidecomputer/console@0895081b) update readme to reflect RFDs now public * [be687595](oxidecomputer/console@be687595) Bump TS 5.2, Zod, and other deps (oxidecomputer/console#1749)
UI changes: * [bb436357](oxidecomputer/console@bb436357) oxidecomputer/console#1755 * [4614fe6f](oxidecomputer/console@4614fe6f) oxidecomputer/console#1747 * [2b3d519d](oxidecomputer/console@2b3d519d) oxidecomputer/console#1750 All changes: oxidecomputer/console@bfb680e...af6536d * [af6536d5](oxidecomputer/console@af6536d5) skip one flaky test in safari ugh * [84b5177b](oxidecomputer/console@84b5177b) oxidecomputer/console#1759 * [26737fd8](oxidecomputer/console@26737fd8) bump pinned omicron to latest * [81e38209](oxidecomputer/console@81e38209) oxidecomputer/console#1758 * [6582b247](oxidecomputer/console@6582b247) increase timeout for image upload error check * [e2147840](oxidecomputer/console@e2147840) Revert mistake commit "curious what it does when we don't say anything" * [7530c3da](oxidecomputer/console@7530c3da) curious what it does when we don't say anything * [bb436357](oxidecomputer/console@bb436357) oxidecomputer/console#1755 * [e1558785](oxidecomputer/console@e1558785) add lint-fast npm script * [4614fe6f](oxidecomputer/console@4614fe6f) oxidecomputer/console#1747 * [14685b11](oxidecomputer/console@14685b11) oxidecomputer/console#1752 * [2b3d519d](oxidecomputer/console@2b3d519d) oxidecomputer/console#1750 * [0895081b](oxidecomputer/console@0895081b) update readme to reflect RFDs now public * [be687595](oxidecomputer/console@be687595) oxidecomputer/console#1749
Fixes #1745. Will make a separate issue for the remaining part of the problem.
I believe the issue is due to both the click outside and focus outside triggering
onDismiss
, which triggers theconfirm()
. My theory so far is that when you cancel out of the confirm, focus returns to the dismissable layer overlay, which triggersonFocusOutside
again.This change fixes the infinite loop of confirms that fully breaks the page, but it does not fix the double confirm when you click elsewhere (this is shown at the end of the recording). Another issue shown in the recording is that when you click the background over the inputs in the side modal, it seems to focus them. This may be directly caused by the
preventDefault
. In any case, it's an improvement on the current broken state.