Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 703 Bytes

set-selection.md

File metadata and controls

32 lines (25 loc) · 703 Bytes

set-selection

https://docs.slatejs.org/concepts/05-operations

editor.apply({
  type: 'set_selection',
  properties: {
    anchor: { path: [0, 0], offset: 0 },
  },
  newProperties: {
    anchor: { path: [0, 0], offset: 15 },
  },
})

break on selection

Editor.insertBreak(editor)

select whole editor for range, from Slate slack

Editor.range(editor, [])
const wholeTranscriptSelection =  Editor.range(editor, []);
Transforms.setSelection(editor, wholeTranscriptSelection)