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:
5
.changeset/cool-baboons-turn.md
Normal file
5
.changeset/cool-baboons-turn.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'slate-react': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix issue when tabbing into editor in Safari (https://github.com/udecode/plate/issues/2315)
|
@@ -15,6 +15,7 @@ import {
|
|||||||
} from '../utils/weak-maps'
|
} from '../utils/weak-maps'
|
||||||
import { RenderLeafProps, RenderPlaceholderProps } from './editable'
|
import { RenderLeafProps, RenderPlaceholderProps } from './editable'
|
||||||
import { useSlateStatic } from '../hooks/use-slate-static'
|
import { useSlateStatic } from '../hooks/use-slate-static'
|
||||||
|
import { IS_SAFARI } from '../utils/environment'
|
||||||
|
|
||||||
function disconnectPlaceholderResizeObserver(
|
function disconnectPlaceholderResizeObserver(
|
||||||
placeholderResizeObserver: MutableRefObject<ResizeObserver | null>,
|
placeholderResizeObserver: MutableRefObject<ResizeObserver | null>,
|
||||||
@@ -125,6 +126,8 @@ const Leaf = (props: {
|
|||||||
opacity: '0.333',
|
opacity: '0.333',
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
|
// Fixes https://github.com/udecode/plate/issues/2315
|
||||||
|
WebkitUserModify: IS_SAFARI ? 'inherit' : undefined,
|
||||||
},
|
},
|
||||||
contentEditable: false,
|
contentEditable: false,
|
||||||
ref: callbackPlaceholderRef,
|
ref: callbackPlaceholderRef,
|
||||||
|
Reference in New Issue
Block a user