Skip to content

Commit c3b3dff

Browse files
committed
Fix CtlSlider not updating when value changed
1 parent 35a17fd commit c3b3dff

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/components/DataTable/DataTable.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ watch(() => appStore.filterPanelControls.filterDataChanged, async () => {
149149
})
150150
151151
watch(() => appStore[currentPageName.value]?.showOrphans, async () => {
152+
let showOrphans = appStore[currentPageName.value].showOrphans
153+
if (showOrphans) {
154+
appStore[currentPageName.value].filters.h4 = 0
155+
appStore[currentPageName.value].filters.r2 = 0
156+
}
152157
await loadDataDebounced()
153158
})
154159

src/components/misc widgets/CtlSlider.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,23 @@ watch(() => resetInput.value, () => {
6363
}
6464
})
6565
66+
watch(
67+
() => {
68+
// Same logic as onSliderChangeEnd to get the value from the store
69+
if (controlSet.topKey === 'filter') {
70+
return appStore[appStore.currentPageName]?.filters?.[controlSet.storeKey]
71+
}
72+
return appStore[appStore.currentPageName]?.[controlSet.storeKey]
73+
},
74+
(newValue) => {
75+
// Use inputValue (not controlValue) and check for undefined
76+
if (newValue !== undefined && newValue !== inputValue.value) {
77+
inputValue.value = newValue
78+
controlLabel.value = `${controlSet.title} ${newValue}`
79+
}
80+
}
81+
)
82+
6683
</script>
6784
6885
<style scoped>

0 commit comments

Comments
 (0)