Skip to content

Commit 99ab2fd

Browse files
Fix search not working when using top slot
1 parent 6ecba23 commit 99ab2fd

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/plugin/VDrilldownTable.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ const searchDebounce = {
626626
maxWait: loadedDrilldown.searchMaxWait as number,
627627
};
628628
629-
// ? Using top.left slot //
629+
// ? Using top or top.left slot //
630630
watchDebounced(
631631
() => props.search,
632632
() => {
@@ -635,7 +635,7 @@ watchDebounced(
635635
searchDebounce,
636636
);
637637
638-
// ? Not using top.left slot //
638+
// ? Not using top or top.left slot //
639639
watchDebounced(
640640
levelSearch,
641641
() => {
@@ -646,11 +646,11 @@ watchDebounced(
646646
647647
// Search - Updated //
648648
function searchUpdated() {
649-
if (!slots['top.left']) {
649+
if (!slots['top'] && !slots['top.left']) {
650650
loadedDrilldown.search = levelSearch.value;
651651
}
652652
653-
if (slots['top.left']) {
653+
if (slots['top'] || slots['top.left']) {
654654
levelSearch.value = props.search || '';
655655
}
656656

src/plugin/slots/TopSlot.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
<script setup lang="ts">
4444
import { KeyStringAny, TopSlotProps } from '@/types';
4545
import { componentName } from '@/plugin/utils/globals';
46-
import { watchDebounced } from '@vueuse/core';
4746
import { AllProps } from '../utils/props';
4847
4948
@@ -105,13 +104,10 @@ function toggleSelectAllCallback() {
105104
106105
107106
// -------------------------------------------------- Search Field //
108-
watchDebounced(
109-
levelSearch,
110-
() => {
111-
emit('update:search', levelSearch.value);
112-
},
113-
{ debounce: 750, maxWait: 1000 },
114-
);
107+
watch(levelSearch, () => {
108+
emit('update:search', levelSearch.value);
109+
});
110+
115111
116112
const boundSearchProps = computed<KeyStringAny>(() => {
117113
return {

0 commit comments

Comments
 (0)