Closed shamoons closed 4 years ago
The delta that's generated looks like:
{"ops":[{"retain":710},{"insert":" yesterday, and she says—”\n“The clinic?","attributes":{"prediction":"prediction"}},{"delete":28}]}
My code is:
const delta = new Delta() .retain(documentData?.prediction?.currentPosition) .delete(previousPredictionText?.length || 0) .insert(predictionText, { prediction: 'prediction' }) console.log('delta', JSON.stringify(delta)) quillEditor.updateContents(delta)
It looks like I should first retain, then delete, then insert, but the generated delta seems to do it in a different order. What am I doing wrong?
retain
delete
insert
delta
Cross linked at https://stackoverflow.com/questions/63430548/why-does-a-qulljs-delta-appear-out-of-order if anyone wants magic internet points
The delta that's generated looks like:
My code is:
It looks like I should first
retain
, thendelete
, theninsert
, but the generateddelta
seems to do it in a different order. What am I doing wrong?Cross linked at https://stackoverflow.com/questions/63430548/why-does-a-qulljs-delta-appear-out-of-order if anyone wants magic internet points