mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-05-01 15:18:47 +08:00
feat(editor): 支持数据源模板输入宽选中文本后编辑(在有数据源变量时还有问题)
This commit is contained in:
parent
094635cc0e
commit
a30e8a3eea
@ -106,9 +106,17 @@ watch(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const mouseupHandler = async () => {
|
const mouseupHandler = async () => {
|
||||||
|
const selection = globalThis.document.getSelection();
|
||||||
|
const anchorOffset = selection?.anchorOffset || 0;
|
||||||
|
const focusOffset = selection?.focusOffset || 0;
|
||||||
|
|
||||||
isFocused.value = true;
|
isFocused.value = true;
|
||||||
await nextTick();
|
await nextTick();
|
||||||
autocomplete.value?.focus();
|
autocomplete.value?.focus();
|
||||||
|
|
||||||
|
if (focusOffset && input.value) {
|
||||||
|
input.value.setSelectionRange(anchorOffset, focusOffset);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const blurHandler = () => {
|
const blurHandler = () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user