Skip to content

Commit

Permalink
Fix issue when tabbing into editor in Safari (#5383)
Browse files Browse the repository at this point in the history
  • Loading branch information
12joan authored Apr 3, 2023
1 parent 5a0d397 commit 3c3ea29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-baboons-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

Fix issue when tabbing into editor in Safari (https://github.com/udecode/plate/issues/2315)
3 changes: 3 additions & 0 deletions packages/slate-react/src/components/leaf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from '../utils/weak-maps'
import { RenderLeafProps, RenderPlaceholderProps } from './editable'
import { useSlateStatic } from '../hooks/use-slate-static'
import { IS_SAFARI } from '../utils/environment'

function disconnectPlaceholderResizeObserver(
placeholderResizeObserver: MutableRefObject<ResizeObserver | null>,
Expand Down Expand Up @@ -125,6 +126,8 @@ const Leaf = (props: {
opacity: '0.333',
userSelect: 'none',
textDecoration: 'none',
// Fixes https://github.com/udecode/plate/issues/2315
WebkitUserModify: IS_SAFARI ? 'inherit' : undefined,
},
contentEditable: false,
ref: callbackPlaceholderRef,
Expand Down

0 comments on commit 3c3ea29

Please sign in to comment.