From 405c433ff93623813e1f043c2b797397f8fef619 Mon Sep 17 00:00:00 2001 From: Shyam-Chen Date: Thu, 21 Nov 2024 15:20:47 +0800 Subject: [PATCH] 1,592nd Commit --- ui/src/components/select/Select.vue | 48 +++++++++++++++------- ui/src/components/text-field/TextField.vue | 20 ++++++--- 2 files changed, 49 insertions(+), 19 deletions(-) diff --git a/ui/src/components/select/Select.vue b/ui/src/components/select/Select.vue index 9cf46f1f..e1de4926 100644 --- a/ui/src/components/select/Select.vue +++ b/ui/src/components/select/Select.vue @@ -86,7 +86,7 @@ async function showPicker() { } // Scroll to the selected option - const active = panel.value?.querySelector('.Select-Item-Active') as HTMLDivElement; + const active = panel.value?.querySelector('.Select-Item.active') as HTMLDivElement; const offsetTop = props.filterable ? active?.offsetTop - 46 : active?.offsetTop; if (offsetTop && list.value) list.value.scrollTop = offsetTop - active.offsetHeight * 2; @@ -179,7 +179,7 @@ function onKeydown(evt: KeyboardEvent) { hoverIndex.value += 1; if (list.value) { - const hover = list.value.querySelector('.Select-Item-Hover') as HTMLDivElement; + const hover = list.value.querySelector('.Select-Item.hover') as HTMLDivElement; const offsetTop = hover?.offsetTop; if (offsetTop) list.value.scrollTop = offsetTop - hover.offsetHeight; } @@ -192,7 +192,7 @@ function onKeydown(evt: KeyboardEvent) { hoverIndex.value -= 1; if (list.value) { - const hover = list.value.querySelector('.Select-Item-Hover') as HTMLDivElement; + const hover = list.value.querySelector('.Select-Item.hover') as HTMLDivElement; const offsetTop = hover?.offsetTop; if (offsetTop) list.value.scrollTop = offsetTop - hover.offsetHeight; } @@ -216,7 +216,7 @@ if (popover.withinPopover) { diff --git a/ui/src/components/text-field/TextField.vue b/ui/src/components/text-field/TextField.vue index 213ad8c4..1ed8681f 100644 --- a/ui/src/components/text-field/TextField.vue +++ b/ui/src/components/text-field/TextField.vue @@ -53,6 +53,16 @@ watch( }, ); +function onPrepend() { + if (props.disabled) return; + emit('prepend'); +} + +function onAppend() { + if (props.disabled) return; + emit('append'); +} + function onClear() { if (props.disabled) return; valueModel.value = ''; @@ -61,14 +71,14 @@ function onClear() {