Skip to content

Commit

Permalink
Do now close DelayedPopover when clicking an item in a dropdown menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
smelamud committed Aug 13, 2023
1 parent 04fb7cf commit 0c9b7ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui/control/DelayedPopper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ class Manager extends React.PureComponent<ManagerProps, ManagerState> {
}

isInPopover(event: MouseEvent) {
for (let element of document.querySelectorAll(".popover-body").values()) {
return this.isInElements(event, ".popover-body") || this.isInElements(event, ".dropdown-menu");
}

isInElements(event: MouseEvent, selector: string) {
for (let element of document.querySelectorAll(selector).values()) {
const r = element.getBoundingClientRect();
if (r.left <= event.clientX && r.right >= event.clientX
&& r.top <= event.clientY && r.bottom >= event.clientY) {
Expand Down

0 comments on commit 0c9b7ef

Please sign in to comment.