Skip to content

Commit

Permalink
Make capitalizing work for iOS (#5654)
Browse files Browse the repository at this point in the history
* Make capitalizing work for iOS

* Add changeset

---------

Co-authored-by: Alexey Starostin <astarostin@astarostin-pc.local>
  • Loading branch information
alex-starostin and Alexey Starostin committed Jun 4, 2024
1 parent 9ee604e commit 2a8b4e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-bats-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': minor
---

Make capitalizing work for iOS
4 changes: 2 additions & 2 deletions packages/slate-react/src/components/string.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Editor, Text, Path, Element, Node } from 'slate'

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

/**
Expand Down Expand Up @@ -129,7 +129,7 @@ export const ZeroWidthString = (props: {

return (
<span {...attributes}>
{!IS_ANDROID || !isLineBreak ? '\uFEFF' : null}
{!(IS_ANDROID || IS_IOS) || !isLineBreak ? '\uFEFF' : null}
{isLineBreak ? <br /> : null}
</span>
)
Expand Down

0 comments on commit 2a8b4e9

Please sign in to comment.