mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-04-19 21:01:57 +02:00
This commit is contained in:
parent
442d263672
commit
33be22f3e3
5
.changeset/purple-walls-kiss.md
Normal file
5
.changeset/purple-walls-kiss.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate': patch
|
||||
---
|
||||
|
||||
Reverted #4804 as it triggered an exception when inserting text with multi-block selection
|
@ -487,8 +487,7 @@ export const TextTransforms: TextTransforms = {
|
||||
if (!voids && Editor.void(editor, { at: end })) {
|
||||
return
|
||||
}
|
||||
const start = Range.start(at)
|
||||
const pointRef = Editor.pointRef(editor, start)
|
||||
const pointRef = Editor.pointRef(editor, end)
|
||||
Transforms.delete(editor, { at, voids })
|
||||
at = pointRef.unref()!
|
||||
Transforms.setSelection(editor, { anchor: at, focus: at })
|
||||
|
@ -0,0 +1,26 @@
|
||||
/** @jsx jsx */
|
||||
import { Transforms } from 'slate'
|
||||
import { jsx } from '../../..'
|
||||
|
||||
export const run = editor => {
|
||||
Transforms.insertText(editor, 'a')
|
||||
}
|
||||
export const input = (
|
||||
<editor>
|
||||
<block>
|
||||
<anchor />
|
||||
first paragraph
|
||||
</block>
|
||||
<block>
|
||||
second
|
||||
<focus /> paragraph
|
||||
</block>
|
||||
</editor>
|
||||
)
|
||||
export const output = (
|
||||
<editor>
|
||||
<block>
|
||||
a<cursor /> paragraph
|
||||
</block>
|
||||
</editor>
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user