Skip to content

Commit 96e6357

Browse files
committed
fixed dialog double closing
1 parent 4c57e4d commit 96e6357

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/game/components/GameSettings.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,17 @@ export const GameSettings = () => {
138138
<StyledGameSettingsDialogWrapper
139139
lightDismiss
140140
open={open}
141-
onWaAfterHide={() => onOpen(false)}
141+
onWaHide={e => {
142+
if (
143+
e.target === e.currentTarget &&
144+
(e.currentTarget as HTMLElement)?.querySelector('wa-dialog[open]')
145+
)
146+
e.preventDefault();
147+
}}
148+
onWaAfterHide={e => {
149+
if (e.target !== e.currentTarget) return;
150+
onOpen(false);
151+
}}
142152
label={'Game Settings'}
143153
style={{
144154
'--width': '920px',

0 commit comments

Comments
 (0)