Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(templates): added portalElement in floating-toolbar component. #3288

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/www/content/docs/components/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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` prop to `floating-toolbar`

## May 2024 #10

Expand Down
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
Loading