mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-02-01 18:06:45 +01:00
refs #3300 Prevent input when suggest is opened
This commit is contained in:
parent
88422646e7
commit
e839513312
@ -109,10 +109,12 @@ export default defineComponent({
|
||||
passive: false,
|
||||
onEventFired(e) {
|
||||
if (e.key === 'Enter' && suggestOpened.value) e.preventDefault()
|
||||
if (e.key === 'ArrowUp' && suggestOpened.value) e.preventDefault()
|
||||
if (e.key === 'ArrowDown' && suggestOpened.value) e.preventDefault()
|
||||
}
|
||||
})
|
||||
|
||||
const { modelValue } = toRefs(props)
|
||||
const { modelValue, fixCursorPos } = toRefs(props)
|
||||
const highlightedIndex = ref(0)
|
||||
const statusRef = ref<HTMLTextAreaElement>()
|
||||
const suggestRef = ref()
|
||||
@ -150,6 +152,9 @@ export default defineComponent({
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
statusRef.value?.focus()
|
||||
if (fixCursorPos.value) {
|
||||
statusRef.value?.setSelectionRange(0, 0)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user