Open eleviven opened 3 months ago
I have the same issue. Did you find a fix or workaround for this?
@momueh I did. It's not ideal but it works.
const EditorBubbles: React.FC<EditorBubblesProps> = () => {
// Added state to keep random value. I'm using current date here
const [key, setKey] = useState(Date.now());
// We will trigger this function when some popover closes. This will update key
const handleOpenChange = (value: boolean) => {
if (value) return;
setKey(Date.now());
};
return (
<Novel.EditorBubble
// And when we update key, this part will be rendered and closed.
key={key}
tippyOptions={{
placement: "top",
}}
>
<NodeSelector onOpenChange={handleOpenChange} />
<Separator orientation="vertical" />
<LinkSelector onOpenChange={handleOpenChange} />
<Separator orientation="vertical" />
<TextButtons />
<Separator orientation="vertical" />
<ColorSelector onOpenChange={handleOpenChange} />
</Novel.EditorBubble>
);
};
Provide environment information
System: OS: macOS 14.5 CPU: (8) arm64 Apple M1 Memory: 76.72 MB / 8.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 21.7.2 - /opt/homebrew/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v20.5.1/bin/yarn npm: 10.8.1 - ~/Desktop/Document/Folder/frontend/node_modules/.bin/npm pnpm: 9.1.0 - ~/.nvm/versions/node/v20.5.1/bin/pnpm
Describe the bug
When I open the popover from the bubble menu and click outside, the popover closes, but the bubble menu remains open. It works as expected when I click options on the bubble menu that are not popovers. You can observe the same issue on the demo site of Novel.
Link to reproduction
https://novel.sh/
To reproduce
It's the wrapper of options which is Bubble Root component
And it's the Popover element on bubble menu
Additional information
No response