From c2f3ff464fca5d6cca00d621507d28a22e40adf9 Mon Sep 17 00:00:00 2001 From: Yadong Zhang Date: Sat, 15 Jun 2024 06:23:54 +0000 Subject: [PATCH 1/3] 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 ( - + Date: Mon, 17 Jun 2024 10:08:06 +0000 Subject: [PATCH 2/3] docs: updated changelog. --- apps/www/content/docs/components/changelog.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/www/content/docs/components/changelog.mdx b/apps/www/content/docs/components/changelog.mdx index 99bb29a1d7..1631acaf42 100644 --- a/apps/www/content/docs/components/changelog.mdx +++ b/apps/www/content/docs/components/changelog.mdx @@ -22,6 +22,7 @@ Use the [CLI](https://platejs.org/docs/components/cli) to install the latest ver - update `mention-input-element` and `slash-input-element` to use the new combobox - feat `draggable`: add the data-key attribute to facilitate adding selection after the drag-and-drop operation is completed - breaking change: Open the caption by using `CaptionButton` or pass the media element's ID through `captionActions.showCaptionId`" +- add `portalElement` in `floating-toolbar` template component, the floating buttons have no tooltips and are not clickable when the editor is in a dialog. ## May 2024 #10 From 16297bc77b316647637d36b144e969be964f2f1e Mon Sep 17 00:00:00 2001 From: Ziad Beyens Date: Mon, 17 Jun 2024 12:13:12 +0200 Subject: [PATCH 3/3] Update changelog.mdx --- apps/www/content/docs/components/changelog.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/www/content/docs/components/changelog.mdx b/apps/www/content/docs/components/changelog.mdx index 1631acaf42..2f86eccf1b 100644 --- a/apps/www/content/docs/components/changelog.mdx +++ b/apps/www/content/docs/components/changelog.mdx @@ -22,7 +22,7 @@ Use the [CLI](https://platejs.org/docs/components/cli) to install the latest ver - update `mention-input-element` and `slash-input-element` to use the new combobox - feat `draggable`: add the data-key attribute to facilitate adding selection after the drag-and-drop operation is completed - breaking change: Open the caption by using `CaptionButton` or pass the media element's ID through `captionActions.showCaptionId`" -- add `portalElement` in `floating-toolbar` template component, the floating buttons have no tooltips and are not clickable when the editor is in a dialog. +- add `portalElement` prop to `floating-toolbar` ## May 2024 #10