mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-02 13:59:16 +08:00
fix(editor): datasource自动补全用鼠标操作出错
This commit is contained in:
parent
f9ba8b8df5
commit
7b2fd6ebd4
@ -16,7 +16,6 @@
|
|||||||
"
|
"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@blur="blurHandler"
|
@blur="blurHandler"
|
||||||
@change="changeHandler"
|
|
||||||
@input="inputHandler"
|
@input="inputHandler"
|
||||||
@select="selectHandler"
|
@select="selectHandler"
|
||||||
>
|
>
|
||||||
@ -111,6 +110,8 @@ const blurHandler = () => {
|
|||||||
isFocused.value = false;
|
isFocused.value = false;
|
||||||
|
|
||||||
setDisplayState();
|
setDisplayState();
|
||||||
|
|
||||||
|
emit('change', state.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeHandler = (v: string) => {
|
const changeHandler = (v: string) => {
|
||||||
@ -314,5 +315,7 @@ const selectHandler = async ({ value, type }: { value: string; type: 'dataSource
|
|||||||
newSelectionStart = dotIndex + suggestText.length + 1;
|
newSelectionStart = dotIndex + suggestText.length + 1;
|
||||||
}
|
}
|
||||||
input.value?.setSelectionRange(newSelectionStart, newSelectionStart);
|
input.value?.setSelectionRange(newSelectionStart, newSelectionStart);
|
||||||
|
|
||||||
|
changeHandler(state.value);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user