Skip to content

Commit

Permalink
fix block-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfeng33 committed Dec 25, 2024
1 parent 1a1dee6 commit 6f57058
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions apps/www/src/registry/default/plate-ui/draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ export const Draggable = withRef<'div', PlateRenderElementProps>(
className={cn(
'relative',
isDragging && 'opacity-50',
STRUCTURAL_TYPES.includes(element.type)
? 'group/structural'
: 'group',
className
STRUCTURAL_TYPES.includes(element.type) ? 'group/structural' : 'group'
)}
>
<Gutter>
Expand Down
6 changes: 4 additions & 2 deletions packages/selection/src/react/BlockSelectionPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@ export const BlockSelectionPlugin = createTPlatePlugin<BlockSelectionConfig>({
const next = new Set(prev);

if (added) {
extractSelectableIds(added).forEach((id) => next.add(id));
extractSelectableIds(added).forEach((id) => id && next.add(id));
}
if (removed) {
extractSelectableIds(removed).forEach((id) => next.delete(id));
extractSelectableIds(removed).forEach(
(id) => id && next.delete(id)
);
}

setOption('selectedIds', next);
Expand Down

0 comments on commit 6f57058

Please sign in to comment.