Skip to content

Commit

Permalink
fix(tooltip, popover): ignore prevented events. #11244
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed Jan 13, 2025
1 parent 2c55557 commit 9870916
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class PopoverManager {
};

private clickHandler = (event: PointerEvent): void => {
if (isKeyboardTriggeredClick(event)) {
if (isKeyboardTriggeredClick(event) || event.defaultPrevented) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export default class TooltipManager {
};

private pointerMoveHandler = (event: PointerEvent): void => {
if (event.defaultPrevented) {
return;
}

const composedPath = event.composedPath();
const { activeTooltip } = this;

Expand Down Expand Up @@ -129,6 +133,10 @@ export default class TooltipManager {
}

private clickHandler = (event: Event): void => {
if (event.defaultPrevented) {
return;
}

this.clickedTooltip = null;
const composedPath = event.composedPath();
const tooltip = this.queryTooltip(composedPath);
Expand Down Expand Up @@ -160,6 +168,10 @@ export default class TooltipManager {
};

private focusInHandler = (event: FocusEvent): void => {
if (event.defaultPrevented) {
return;
}

const composedPath = event.composedPath();
const tooltip = this.queryTooltip(composedPath);

Expand Down

0 comments on commit 9870916

Please sign in to comment.