function keyCommandMoveSelectionToStartOfBlock(
  editorState: EditorState,
): EditorState {
  const selection = editorState.getSelection();
  const startKey = selection.getStartKey();
  return EditorState.set(editorState, {
    selection: selection.merge({
      anchorKey: startKey,
      anchorOffset: 0,
      focusKey: startKey,
      focusOffset: 0,
      isBackward: false,
    }),
    forceSelection: true,
  });
}
Collapse selection at the start of the first selected block. This is used
for Firefox versions that attempt to navigate forward/backward instead of
moving the cursor. Other browsers are able to move the cursor natively.