mirror of
https://github.com/outline/outline.git
synced 2026-05-03 16:09:52 -05:00
d5341a486c
Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>
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;
|