Files
outline/shared/editor/commands/collapseSelection.ts
2023-05-24 19:24:05 -07:00

13 lines
293 B
TypeScript

import { Command, TextSelection } from "prosemirror-state";
const collapseSelection = (): Command => (state, dispatch) => {
dispatch?.(
state.tr.setSelection(
TextSelection.create(state.doc, state.tr.selection.from)
)
);
return true;
};
export default collapseSelection;