Skip to content

Commit

Permalink
close popul when user clicks out of its area
Browse files Browse the repository at this point in the history
  • Loading branch information
JosiasAurel committed Feb 23, 2024
1 parent 6375213 commit 9a05c11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/navbar-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export default function EditorNavbar(props: EditorNavbarProps) {
if (!_showNavPopup && _resetState === 'confirm') resetState.value = 'idle'
})

// usePopupCloseClick closes a popup when you click outside of its area
usePopupCloseClick(styles.navPopup!, () => showNavPopup.value = false, showNavPopup.value)
usePopupCloseClick(styles.stuckPopup!, () => showStuckPopup.value = false, showStuckPopup.value)

let saveState
let actionButton
Expand Down Expand Up @@ -161,9 +163,7 @@ export default function EditorNavbar(props: EditorNavbarProps) {
</li>

<li>
<Button class={styles.stuckBtn} onClick={() => {
showStuckPopup.value = !showStuckPopup.value;
}}>
<Button class={styles.stuckBtn} onClick={() => showStuckPopup.value = !showStuckPopup.value}>
I'm stuck
</Button>
</li>
Expand Down

0 comments on commit 9a05c11

Please sign in to comment.