feat: Comment resolving (#7115)
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { Command, TextSelection } from "prosemirror-state";
|
||||
|
||||
const collapseSelection = (): Command => (state, dispatch) => {
|
||||
/**
|
||||
* A prosemirror command to collapse the current selection to a cursor at the start of the selection.
|
||||
*
|
||||
* @returns A prosemirror command.
|
||||
*/
|
||||
export const collapseSelection = (): Command => (state, dispatch) => {
|
||||
dispatch?.(
|
||||
state.tr.setSelection(
|
||||
TextSelection.create(state.doc, state.tr.selection.from)
|
||||
@@ -8,5 +13,3 @@ const collapseSelection = (): Command => (state, dispatch) => {
|
||||
);
|
||||
return true;
|
||||
};
|
||||
|
||||
export default collapseSelection;
|
||||
|
||||
Reference in New Issue
Block a user