Skip to content

Commit 3ac669f

Browse files
authored
Merge pull request #5933 from pat270/LPD-48347
fix(@clayui/shared): LPD-48347 Close overlay on left click only
2 parents 73b235f + f19214a commit 3ac669f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/clay-shared/src/Overlay.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,11 @@ export function Overlay({
114114

115115
useInteractOutside({
116116
isDisabled: isOpen ? !isCloseOnInteractOutside : true,
117-
onInteract: () => {
118-
onHide('blur');
117+
onInteract: (event) => {
118+
// @ts-ignore
119+
if (event.button === 0) {
120+
onHide('blur');
121+
}
119122
},
120123
onInteractStart: (event) => {
121124
if (overlayStack[overlayStack.length - 1] === menuRef) {

0 commit comments

Comments
 (0)