From c1f72e0d1126c3bece739610d37db0dc976df427 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 16 Jun 2023 12:21:51 -0500 Subject: [PATCH] Fix grid filter bug when switching from 'equal' to 'between' verbs and vice versa --- tailbone/static/js/tailbone.buefy.grid.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tailbone/static/js/tailbone.buefy.grid.js b/tailbone/static/js/tailbone.buefy.grid.js index 75037448..6be28f41 100644 --- a/tailbone/static/js/tailbone.buefy.grid.js +++ b/tailbone/static/js/tailbone.buefy.grid.js @@ -28,6 +28,17 @@ const GridFilterNumericValue = { this.startValue = this.value } }, + watch: { + // when changing from e.g. 'equal' to 'between' filter verbs, + // must proclaim new filter value, to reflect (lack of) range + wantsRange(val) { + if (val) { + this.$emit('input', this.startValue + '|' + this.endValue) + } else { + this.$emit('input', this.startValue) + } + }, + }, methods: { focus() { this.$refs.startValue.focus()