mirror of
https://github.com/heyman/heynote.git
synced 2025-06-20 17:47:42 +02:00
Move cursor to end of document and scroll it into view
This commit is contained in:
parent
5a4a092521
commit
570fdba08b
@ -57,7 +57,7 @@ editor.update([
|
|||||||
editor.state.update({
|
editor.state.update({
|
||||||
changes:{
|
changes:{
|
||||||
from: 0,
|
from: 0,
|
||||||
to: editor.state.length,
|
to: editor.state.doc.length,
|
||||||
insert: initialData,
|
insert: initialData,
|
||||||
},
|
},
|
||||||
annotations: heynoteEvent.of(INITIAL_DATA),
|
annotations: heynoteEvent.of(INITIAL_DATA),
|
||||||
@ -66,7 +66,8 @@ editor.update([
|
|||||||
|
|
||||||
|
|
||||||
editor.dispatch({
|
editor.dispatch({
|
||||||
selection: {anchor: 0, head: 0},
|
selection: {anchor: editor.state.doc.length, head: editor.state.doc.length},
|
||||||
|
scrollIntoView: true,
|
||||||
})
|
})
|
||||||
editor.focus()
|
editor.focus()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user