mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-01-17 13:38:37 +01:00
Fixed triple click workaround breaking void elements selection (#5451)
* Fixed tripple click workaround breaking void selection * Add changesets * Fix ts error * Make code style more consistent
This commit is contained in:
parent
bac37cae81
commit
12ff246e10
5
.changeset/popular-shrimps-give.md
Normal file
5
.changeset/popular-shrimps-give.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate-react': minor
|
||||
---
|
||||
|
||||
Fixed occasional crashes when selecting void elements in Chrome
|
@ -869,7 +869,8 @@ export const ReactEditor: ReactEditorInterface = {
|
||||
// will cause `toSlatePoint` to throw an error. (2023/03/07)
|
||||
if (
|
||||
'getAttribute' in focusNode &&
|
||||
(focusNode as HTMLElement).getAttribute('contenteditable') === 'false'
|
||||
(focusNode as HTMLElement).getAttribute('contenteditable') === 'false' &&
|
||||
(focusNode as HTMLElement).getAttribute('data-slate-void') !== 'true'
|
||||
) {
|
||||
focusNode = anchorNode
|
||||
focusOffset = anchorNode.textContent?.length || 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user