13 lines
293 B
TypeScript
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;
|