Skip to content

Commit 2a8b4e9

Browse files
alex-starostinAlexey Starostin
andauthored
Make capitalizing work for iOS (#5654)
* Make capitalizing work for iOS * Add changeset --------- Co-authored-by: Alexey Starostin <astarostin@astarostin-pc.local>
1 parent 9ee604e commit 2a8b4e9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/stale-bats-jog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'slate-react': minor
3+
---
4+
5+
Make capitalizing work for iOS

packages/slate-react/src/components/string.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Editor, Text, Path, Element, Node } from 'slate'
33

44
import { ReactEditor, useSlateStatic } from '..'
55
import { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect'
6-
import { IS_ANDROID } from '../utils/environment'
6+
import { IS_ANDROID, IS_IOS } from '../utils/environment'
77
import { MARK_PLACEHOLDER_SYMBOL } from '../utils/weak-maps'
88

99
/**
@@ -129,7 +129,7 @@ export const ZeroWidthString = (props: {
129129

130130
return (
131131
<span {...attributes}>
132-
{!IS_ANDROID || !isLineBreak ? '\uFEFF' : null}
132+
{!(IS_ANDROID || IS_IOS) || !isLineBreak ? '\uFEFF' : null}
133133
{isLineBreak ? <br /> : null}
134134
</span>
135135
)

0 commit comments

Comments
 (0)