Skip to content

Commit

Permalink
Close MenuSelect tooltip if opening dropdown options
Browse files Browse the repository at this point in the history
This ensures menu items aren't blocked, etc., and the tooltip need not
continue to be displayed if you've already clicked the select.

Resolves #308
  • Loading branch information
sjdemartini committed Dec 22, 2024
1 parent 8a9b020 commit 135c7d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/controls/MenuSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ export default function MenuSelect<T>({
setTooltipOpen(false);
selectProps.onClick?.(...args);
}}
onOpen={(...args) => {
// Close the tooltip when the dropdown is opened. This can ensure the
// tooltip doesn't block menu items, etc. (see
// https://github.com/sjdemartini/mui-tiptap/issues/308).
setTooltipOpen(false);
selectProps.onOpen?.(...args);
}}
inputProps={{
...selectProps.inputProps,
className: cx(classes.input, selectProps.inputProps?.className),
Expand Down

0 comments on commit 135c7d0

Please sign in to comment.