1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-10 18:10:54 +09:00

JS-2687: fix

This commit is contained in:
Andrew Simachev 2023-07-31 21:23:36 +02:00
parent c540343a08
commit bc333cb87e
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8

View file

@ -1218,6 +1218,10 @@ const EditorPage = observer(class EditorPage extends React.Component<Props, Stat
const mark = Mark.getInRange(marks, type, range);
const win = $(window);
const cb = () => {
focus.set(block.id, range);
focus.apply();
};
if (type == I.MarkType.Link) {
menuStore.close('blockContext', () => {
@ -1233,14 +1237,14 @@ const EditorPage = observer(class EditorPage extends React.Component<Props, Stat
type: mark ? mark.type : null,
onChange: (newType: I.MarkType, param: string) => {
marks = Mark.toggleLink({ type: newType, param, range }, marks);
UtilData.blockSetText(rootId, block.id, text, marks, true, () => { focus.apply(); });
UtilData.blockSetText(rootId, block.id, text, marks, true, cb);
}
}
});
});
} else {
marks = Mark.toggle(marks, { type: type, param: mark ? '' : param, range: range });
UtilData.blockSetText(rootId, block.id, text, marks, true, () => { focus.apply(); });
marks = Mark.toggle(marks, { type, param: mark ? '' : param, range });
UtilData.blockSetText(rootId, block.id, text, marks, true, cb);
};
};