Skip to content

Commit

Permalink
Merge pull request #3675 from udecode/fix/color
Browse files Browse the repository at this point in the history
Fix `DefaultLeaf` missing style attribute
  • Loading branch information
zbeyens authored Oct 27, 2024
2 parents 0bf7fcf + 9a897f2 commit b20223c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-snails-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-core': patch
---

Fix `DefaultLeaf` missing style attribute
12 changes: 10 additions & 2 deletions packages/core/src/react/components/DefaultLeaf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import React from 'react';

import type { PlateRenderLeafProps } from '../plugin/PlateRenderLeafProps';

export function DefaultLeaf({ attributes, children }: PlateRenderLeafProps) {
return <span {...attributes}>{children}</span>;
export function DefaultLeaf({
attributes,
children,
style,
}: PlateRenderLeafProps & { style?: React.CSSProperties }) {
return (
<span {...attributes} style={style}>
{children}
</span>
);
}

0 comments on commit b20223c

Please sign in to comment.