diff --git a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte index ca3cb57bdd..ac3a9c4e95 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte +++ b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte @@ -98,6 +98,22 @@ function isDate(field) { return viewModel.schema[field].type === "datetime" } + + function isNumber(field) { + return viewModel.schema[field].type === "number" + } + + const fieldChanged = filter => ev => { + // reset if type changed + if ( + filter.key && + ev.target.value && + viewModel.schema[filter.key].type !== + viewModel.schema[ev.target.value].type + ) { + filter.value = "" + } + }