Skip to content

Commit

Permalink
Use editor API isCollapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
cskrov committed Feb 5, 2025
1 parent cd9020a commit 807ccf4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions frontend/src/plate/toolbar/toolbars/floating-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useSelection } from '@app/plate/hooks/use-selection';
import { FloatingRedaktoerToolbarButtons } from '@app/plate/toolbar/toolbars/floating-redaktoer-toolbar-buttons';
import { FloatingSaksbehandlerToolbarButtons } from '@app/plate/toolbar/toolbars/floating-saksbehandler-toolbar-buttons';
import { useMyPlateEditorRef } from '@app/plate/types';
import { RangeApi } from '@udecode/plate';
import { BaseTablePlugin } from '@udecode/plate-table';
import { useMemo, useState } from 'react';
import { styled } from 'styled-components';
Expand Down Expand Up @@ -38,7 +37,7 @@ const FloatingToolbar = ({ editorId, container, children }: FloatingToolbarProps
[container, position, toolbarRef],
);

if (isInTable || !isFocused || position === null || RangeApi.isCollapsed(selection)) {
if (isInTable || !isFocused || position === null || editor.api.isCollapsed()) {
return null;
}

Expand Down

0 comments on commit 807ccf4

Please sign in to comment.