Skip to content

Commit 636409c

Browse files
authored
Merge pull request #4459 from DND-IT/fix-non-breaking-space-height
2 parents 90ec3db + 89ea3b8 commit 636409c

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/beige-days-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@platejs/core': patch
3+
---
4+
5+
Fix jumpy non-breaking-space

packages/core/src/lib/static/components/slate-nodes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export type StyledSlateLeafProps<
161161
SlateHTMLProps<C, T>;
162162

163163
const NonBreakingSpace = () => (
164-
<span style={{ fontSize: 0 }} contentEditable={false}>
164+
<span style={{ fontSize: 0, lineHeight: 0 }} contentEditable={false}>
165165
{String.fromCodePoint(160)}
166166
</span>
167167
);

packages/core/src/react/components/plate-nodes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export type StyledPlateLeafProps<
177177
PlateHTMLProps<C, T>;
178178

179179
const NonBreakingSpace = () => (
180-
<span style={{ fontSize: 0 }} contentEditable={false}>
180+
<span style={{ fontSize: 0, lineHeight: 0 }} contentEditable={false}>
181181
{String.fromCodePoint(160)}
182182
</span>
183183
);

0 commit comments

Comments
 (0)