revert remaining changes

pull/35843/head
silverwind 2025-12-03 02:01:16 +07:00
parent 187d63bd54
commit a94b9cb067
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443
1 changed files with 4 additions and 4 deletions

@ -32,7 +32,7 @@ const filteredFiles = computed(() => {
});
const applySearchQuery = throttle(300, () => {
searchQuery.value = refElemInput.value.value ?? '';
searchQuery.value = refElemInput.value.value;
selectedIndex.value = 0;
});
@ -52,7 +52,7 @@ const handleKeyDown = (e: KeyboardEvent) => {
const handleSelectedItem = (idx: number) => {
e.preventDefault();
selectedIndex.value = idx;
const el = refElemPopup.value?.querySelector(`.file-search-results > :nth-child(${idx+1} of .item)`);
const el = refElemPopup.value.querySelector(`.file-search-results > :nth-child(${idx+1} of .item)`);
el?.scrollIntoView({ block: 'nearest', behavior: 'instant' });
};
@ -121,8 +121,8 @@ const updatePosition = () => {
onMounted(() => {
const searchPopupId = generateElemId('file-search-popup-');
refElemPopup.value?.setAttribute('id', searchPopupId);
refElemInput.value?.setAttribute('aria-controls', searchPopupId);
refElemPopup.value.setAttribute('id', searchPopupId);
refElemInput.value.setAttribute('aria-controls', searchPopupId);
document.addEventListener('click', handleClickOutside);
window.addEventListener('resize', updatePosition);
});