Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Prevent useContextMenu isOpen from being true if the button ref goes away #9418

Merged
merged 13 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/structures/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ export const useContextMenu = <T extends any = HTMLElement>(): ContextMenuTuple<
setIsOpen(false);
};

return [isOpen, button, open, close, setIsOpen];
return [button.current && isOpen, button, open, close, setIsOpen];
};

// XXX: Deprecated, used only for dynamic Tooltips. Avoid using at all costs.
Expand Down
3 changes: 2 additions & 1 deletion src/components/views/rooms/ReadReceiptGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ export function ReadReceiptGroup(
onMouseOver={showTooltip}
onMouseLeave={hideTooltip}
onFocus={showTooltip}
onBlur={hideTooltip}>
onBlur={hideTooltip}
>
{ remText }
<span
className="mx_ReadReceiptGroup_container"
Expand Down