sjdemartini / mui-tiptap

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

LinkBubbleMenu not displayed if your Editor is inside a MUI Dialog modal #265

Closed alaa-paramount closed 1 week ago

alaa-paramount commented 3 months ago

Is your feature request related to a problem? Please describe.

LinkBubbleMenu is using MuiPopper wrapper, the problem is with the zIndex value between 3-4 by default (bug?)

Describe the solution you'd like

My expectation is to see the Link bubble menu from anyway, even when executing it inside a Dialog modal (but we see nothing on click)

Describe alternatives you've considered

My temp solution is to add this code to my createTheme to make it work: createTheme({ MuiPopper: { styleOverrides: { root: { // a fix for the tiptap links inside a modal zIndex: "1300 !important" } } } })

mohanlokesh commented 2 months ago

I am also facing this issue in my MUI drawer, I have used like this in createTheme as alternative.

MuiPopper: {
        styleOverrides: {
          root: {
            '&.MuiTiptap-ControlledBubbleMenu-root': {
              zIndex: 'var(--mui-zIndex-drawer)'
            },
            '&.MuiPopper-root[class*="ColorPickerPopper-root"]': {
              zIndex: 'var(--mui-zIndex-drawer)'
            }
          }
        }
sjdemartini commented 2 months ago

There is another approach that's been discussed before here to avoid this problem https://github.com/sjdemartini/mui-tiptap/issues/206#issuecomment-2133851815

But I'll look into changing the default zIndex style too.

sjdemartini commented 1 week ago

I've updated the default z-index of the bubble menus and poppers to use theme.zIndex.tooltip to fix this problem, released in v1.14.0.

alaa-paramount commented 1 week ago

@sjdemartini Great, thanks!