Skip to content

Commit 9151ffa

Browse files
committed
Merge branch 'release/v24.0.0' into fix/reInitAutoCompleteField
2 parents 909fa93 + 7c474eb commit 9151ffa

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/components/AutoSuggestion/extensions/markText.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,17 @@ type marksConfig = {
3535

3636
export const markText = (config: marksConfig) => {
3737
const docLength = config.view.state.doc.length;
38-
if (!docLength) return { from: 0, to: 0 };
3938
const strikeMark = Decoration.mark({
4039
class: config.className,
4140
attributes: {
4241
title: config.title ?? "",
4342
},
4443
});
4544
const stopRange = Math.min(config.to, docLength);
45+
if (!docLength || config.from === stopRange) return { from: 0, to: 0 };
4646
config.view.dispatch({
4747
effects: addMarks.of([strikeMark.range(config.from, stopRange)] as any),
4848
});
49-
5049
return { from: config.from, to: stopRange };
5150
};
5251

0 commit comments

Comments
 (0)