Skip to content

Commit

Permalink
fix(web): prevent accidental modal closures on mouseup outside (#15900)
Browse files Browse the repository at this point in the history
  • Loading branch information
afv authored Feb 4, 2025
1 parent 5015210 commit 97574d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/lib/actions/click-outside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ export function clickOutside(node: HTMLElement, options: Options = {}): ActionRe
}
};

document.addEventListener('click', handleClick, true);
document.addEventListener('mousedown', handleClick, true);
node.addEventListener('keydown', handleKey, false);

return {
destroy() {
document.removeEventListener('click', handleClick, true);
document.removeEventListener('mousedown', handleClick, true);
node.removeEventListener('keydown', handleKey, false);
},
};
Expand Down

0 comments on commit 97574d7

Please sign in to comment.