File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/react-core/src/components/Popover Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -334,10 +334,10 @@ export const Popover: React.FunctionComponent<PopoverProps> = ({
334334 } ;
335335 const onDocumentClick = ( event : MouseEvent , triggerElement : HTMLElement , popperElement : HTMLElement ) => {
336336 if ( hideOnOutsideClick && visible ) {
337- // check if we clicked within the popper, if so don't do anything
338- const isChild = popperElement && popperElement . contains ( event . target as Node ) ;
339- if ( isChild ) {
340- // clicked within the popper
337+ const isFromChild = popperElement && popperElement . contains ( event . target as Node ) ;
338+ const isFromTrigger = triggerElement && triggerElement . contains ( event . target as Node ) ;
339+ if ( isFromChild || isFromTrigger ) {
340+ // if clicked within the popper or on the trigger, ignore this event
341341 return ;
342342 }
343343 if ( triggerManually ) {
You can’t perform that action at this time.
0 commit comments