sjdemartini / mui-tiptap

A Material UI (MUI) styled WYSIWYG rich text editor, using Tiptap
MIT License
316 stars 43 forks source link

Add option to make tooltips non-interactive #282

Open gsj-bgw opened 4 weeks ago

gsj-bgw commented 4 weeks ago

Interactive tooltips sometimes get in the way of clicking menu buttons. It would be nice to have an option to make them non-interactive, or at least provide a CSS class name to target them to turn off pointer events.

markdon commented 2 weeks ago

I'm seeing tooltips blocking other buttons: MFuyq1rZBj

MenuButton TooltipProps

The MenuButton* components could have a TooltipProps prop that is passed to MenuButton, which spreads the props on MenuButtonTooltip, which already accepts additional props for Tooltip.

This would enable setting disableInteractive on the Tooltip among other things.

MenuButtonTooltipContext

Something to consider though, is that a menu bar probably has a lot of MenuButton*s, like this example. So to avoid having to specify the same prop on every single MenuButton*, maybe a MenuButtonTooltipContext would be appropriate. Providing the tooltip props to a Context in our MenuControls component and the MenuButtonTooltip can read that context value and pass those props to Tooltip.

It looks very likely we'll use mui-tiptap in our application, so I could write a PR for this.

sjdemartini commented 10 hours ago

Thanks for filing. Sounds good to me to add TooltipProps as part of MenuButton. The context option also seems reasonable, but perhaps that can be its own PR, to review/consider in isolation. Would be open to PRs for both, as I don't have time to work on this enhancement myself.