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