Make quick action dropdowns use capture phase of the event to trigger closure on outside click (#5414)
This commit is contained in:
parent
a0ed51c845
commit
890379b64f
9 changed files with 12 additions and 4 deletions
|
|
@ -35,6 +35,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => {
|
|||
tabIndex,
|
||||
closeOnSelect,
|
||||
openOnHover = false,
|
||||
useCaptureForOutsideClick = false,
|
||||
} = props;
|
||||
|
||||
const [referenceElement, setReferenceElement] = React.useState<HTMLButtonElement | null>(null);
|
||||
|
|
@ -88,7 +89,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => {
|
|||
}
|
||||
};
|
||||
|
||||
useOutsideClickDetector(dropdownRef, closeDropdown);
|
||||
useOutsideClickDetector(dropdownRef, closeDropdown, useCaptureForOutsideClick);
|
||||
|
||||
let menuItems = (
|
||||
<Menu.Items className={cn("fixed z-10", menuItemsClassName)} static>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ export interface IDropdownProps {
|
|||
optionsClassName?: string;
|
||||
placement?: Placement;
|
||||
tabIndex?: number;
|
||||
useCaptureForOutsideClick?: boolean;
|
||||
}
|
||||
|
||||
export interface ICustomMenuDropdownProps extends IDropdownProps {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue