Skip to content

Commit

Permalink
fix(templates): support portalElement in floating-toolbar to fix the …
Browse files Browse the repository at this point in the history
…toolbar button is no tooltip and not clickable issue.
  • Loading branch information
zhyd1997 committed Jun 17, 2024
1 parent 125f11d commit c2f3ff4
Showing 1 changed file with 3 additions and 2 deletions.
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 c2f3ff4

Please sign in to comment.