From c2f3ff464fca5d6cca00d621507d28a22e40adf9 Mon Sep 17 00:00:00 2001 From: Yadong Zhang Date: Sat, 15 Jun 2024 06:23:54 +0000 Subject: [PATCH] fix(templates): support portalElement in floating-toolbar to fix the toolbar button is no tooltip and not clickable issue. --- .../src/components/plate-ui/floating-toolbar.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/plate-playground-template/src/components/plate-ui/floating-toolbar.tsx b/templates/plate-playground-template/src/components/plate-ui/floating-toolbar.tsx index 61d75e1979..5409369966 100644 --- a/templates/plate-playground-template/src/components/plate-ui/floating-toolbar.tsx +++ b/templates/plate-playground-template/src/components/plate-ui/floating-toolbar.tsx @@ -16,9 +16,10 @@ import { Toolbar } from './toolbar'; export const FloatingToolbar = withRef< typeof Toolbar, { + portalElement?: Element state?: FloatingToolbarState; } ->(({ state, children, ...props }, componentRef) => { +>(({ state, portalElement, children, ...props }, componentRef) => { const floatingToolbarState = useFloatingToolbarState({ ...state, floatingOptions: { @@ -50,7 +51,7 @@ export const FloatingToolbar = withRef< if (hidden) return null; return ( - +