1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-11 17:53:59 +02:00

Fix issue when tabbing into editor in Safari (#5383)

https://github.com/udecode/plate/issues/2315
This commit is contained in:
Joe Anderson
2023-04-03 19:00:59 +01:00
committed by GitHub
parent 5a0d3974d6
commit 3c3ea29a2d
2 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
'slate-react': patch
---
Fix issue when tabbing into editor in Safari (https://github.com/udecode/plate/issues/2315)

View File

@@ -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>,
@@ -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,