Skip to content

Commit

Permalink
fix: Failed to execute removeChild (#10886)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dschoordsch authored Feb 17, 2025
1 parent 2b4d134 commit ddff9dd
Showing 1 changed file with 34 additions and 31 deletions.
65 changes: 34 additions & 31 deletions packages/client/components/promptResponse/StandardBubbleMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,40 @@ export const StandardBubbleMenu = (props: Props) => {
editor.emit('linkStateChange', {editor, linkState: 'edit'})
}

// wrapping in div is necessary, https://github.com/ueberdosis/tiptap/issues/3784
return (
<BubbleMenu editor={editor} tippyOptions={{duration: 100}} shouldShow={shouldShowBubbleMenu}>
<div className='flex items-center rounded-sm border-[1px] border-solid border-slate-600 bg-white p-[3px]'>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleBold().run()}
isActive={editor.isActive('bold')}
>
<b>B</b>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleItalic().run()}
isActive={editor.isActive('italic')}
>
<i>I</i>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleUnderline().run()}
isActive={editor.isActive('underline')}
>
<u>U</u>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleStrike().run()}
isActive={editor.isActive('strike')}
>
<s>S</s>
</BubbleMenuButton>
<BubbleMenuButton onClick={openLinkEditor}>
<Link className='h-[18px] w-[18px]' />
</BubbleMenuButton>
</div>
</BubbleMenu>
<div>
<BubbleMenu editor={editor} tippyOptions={{duration: 100}} shouldShow={shouldShowBubbleMenu}>
<div className='flex items-center rounded-sm border-[1px] border-solid border-slate-600 bg-white p-[3px]'>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleBold().run()}
isActive={editor.isActive('bold')}
>
<b>B</b>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleItalic().run()}
isActive={editor.isActive('italic')}
>
<i>I</i>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleUnderline().run()}
isActive={editor.isActive('underline')}
>
<u>U</u>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleStrike().run()}
isActive={editor.isActive('strike')}
>
<s>S</s>
</BubbleMenuButton>
<BubbleMenuButton onClick={openLinkEditor}>
<Link className='h-[18px] w-[18px]' />
</BubbleMenuButton>
</div>
</BubbleMenu>
</div>
)
}

0 comments on commit ddff9dd

Please sign in to comment.