Skip to content

Commit 22e16f8

Browse files
author
Gido Manders
committed
fix: Cannot specify trigger prop in controlled mode
In the popover, when using isOpen, it enters controlled mode. In controlled mode, the trigger property is not allowed. Added check to trigger property to only specify when isOpen is undefined
1 parent 10ba6e0 commit 22e16f8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/Popover/Popover.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ export function Popover({
113113
interactive={true}
114114
zIndex={1049} // One level below bootstrap's modal
115115
maxWidth={maxWidth}
116-
trigger={openOnClick ? 'click' : 'mouseenter focus'}
116+
trigger={
117+
isOpen !== undefined
118+
? undefined
119+
: openOnClick
120+
? 'click'
121+
: 'mouseenter focus'
122+
}
117123
>
118124
<Tag
119125
className={className}

0 commit comments

Comments
 (0)