Skip to content

Commit

Permalink
Merge pull request #3288 from zhyd1997/fix/floating-toolbar-in-dialog…
Browse files Browse the repository at this point in the history
…-1718432542507

fix(templates): added `portalElement` in `floating-toolbar` component.
  • Loading branch information
zbeyens committed Jun 17, 2024
1 parent a7a192e commit cb07619
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/plate-ui/floating-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -50,7 +51,7 @@ export const FloatingToolbar = withRef<
if (hidden) return null;

return (
<PortalBody>
<PortalBody element={portalElement}>
<Toolbar
ref={ref}
className={cn(
Expand Down

0 comments on commit cb07619

Please sign in to comment.