Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfeng33 committed Dec 25, 2024
1 parent 6771735 commit a4ed2bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ export function NumberedIndentListToolbarButton() {
return (
<ToolbarSplitButton pressed={openState.open} tooltip="Numbered List">
<ToolbarSplitButtonPrimary
className="data-[state=on]:bg-accent data-[state=on]:text-accent-foreground"
onClick={() => {
toggleIndentList(editor, {
listStyleType: ListStyleType.Decimal,
});
}}
pressed={pressed}
data-state={pressed ? 'on' : 'off'}
>
<ListOrdered className="size-4" />
</ToolbarSplitButtonPrimary>
Expand Down Expand Up @@ -129,12 +130,13 @@ export function BulletedIndentListToolbarButton() {
return (
<ToolbarSplitButton pressed={openState.open} tooltip="Bulleted List">
<ToolbarSplitButtonPrimary
className="data-[state=on]:bg-accent data-[state=on]:text-accent-foreground"
onClick={() => {
toggleIndentList(editor, {
listStyleType: ListStyleType.Disc,
});
}}
pressed={pressed}
data-state={pressed ? 'on' : 'off'}
>
<List className="size-4" />
</ToolbarSplitButtonPrimary>
Expand Down
8 changes: 2 additions & 6 deletions apps/www/src/registry/default/plate-ui/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,8 @@ export const ToolbarSplitButton = React.forwardRef<

export const ToolbarSplitButtonPrimary = React.forwardRef<
React.ElementRef<typeof ToolbarToggleItem>,
Omit<React.ComponentPropsWithoutRef<typeof ToolbarToggleItem>, 'value'> & {
pressed?: boolean;
}
>(({ children, className, pressed, size, variant, ...props }, ref) => {
Omit<React.ComponentPropsWithoutRef<typeof ToolbarToggleItem>, 'value'>
>(({ children, className, size, variant, ...props }, ref) => {
return (
<span
ref={ref}
Expand All @@ -186,10 +184,8 @@ export const ToolbarSplitButtonPrimary = React.forwardRef<
}),
'rounded-r-none',
'group-data-[pressed=true]:bg-accent group-data-[pressed=true]:text-accent-foreground',
pressed && 'bg-accent text-accent-foreground',
className
)}
data-pressed={pressed}
{...props}
>
{children}
Expand Down

0 comments on commit a4ed2bf

Please sign in to comment.