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,
|
passive: false,
|
||||||
onEventFired(e) {
|
onEventFired(e) {
|
||||||
if (e.key === 'Enter' && suggestOpened.value) e.preventDefault()
|
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 highlightedIndex = ref(0)
|
||||||
const statusRef = ref<HTMLTextAreaElement>()
|
const statusRef = ref<HTMLTextAreaElement>()
|
||||||
const suggestRef = ref()
|
const suggestRef = ref()
|
||||||
|
@ -150,6 +152,9 @@ export default defineComponent({
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
statusRef.value?.focus()
|
statusRef.value?.focus()
|
||||||
|
if (fixCursorPos.value) {
|
||||||
|
statusRef.value?.setSelectionRange(0, 0)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue