Skip to content

Commit

Permalink
fix: Cannot specify trigger prop in controlled mode
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Gido Manders committed Dec 13, 2024
1 parent 10ba6e0 commit 22e16f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ export function Popover({
interactive={true}
zIndex={1049} // One level below bootstrap's modal
maxWidth={maxWidth}
trigger={openOnClick ? 'click' : 'mouseenter focus'}
trigger={
isOpen !== undefined
? undefined
: openOnClick
? 'click'
: 'mouseenter focus'
}
>
<Tag
className={className}
Expand Down

0 comments on commit 22e16f8

Please sign in to comment.