From 22e16f813d2d2f74f8d654a4588f013a644e91b3 Mon Sep 17 00:00:00 2001 From: Gido Manders Date: Fri, 13 Dec 2024 16:46:14 +0100 Subject: [PATCH] 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 --- src/core/Popover/Popover.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/Popover/Popover.tsx b/src/core/Popover/Popover.tsx index 712b1121..9ea3ec2d 100644 --- a/src/core/Popover/Popover.tsx +++ b/src/core/Popover/Popover.tsx @@ -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' + } >