fix: reset button restores searchable_default values instead of clearing all filters#596
Draft
fix: reset button restores searchable_default values instead of clearing all filters#596
Conversation
…ing all filters
When searchable_default is configured, clicking the reset button now restores
the default filter values instead of clearing all fields to null. Amis formula
values (e.g. ${NOW()}) are re-evaluated at reset time. The search button red
dot indicator correctly reflects whether default values are non-empty.
Co-authored-by: yinlianghui <6219465+yinlianghui@users.noreply.github.com>
Agent-Logs-Url: https://github.com/steedos/steedos-widgets/sessions/4d0ad638-7626-425c-a8cd-57fa2e760274
Copilot
AI
changed the title
[WIP] Optimize reset button behavior in search form
fix: reset button restores searchable_default values instead of clearing all filters
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
searchable_defaultis configured, the search form reset button was clearing all__searchable__fields to null instead of restoring the configured defaults.Changes in
fields_filter.js→onCancelScript__searchable__fields, re-readssearchable_default(injected at build time viaJSON.stringify, same pattern asdataProviderInited), evaluates amis formulas withAmisCore.evaluate(), converts viaSteedosUI.getSearchFilterFormValues(), and merges intoremovedValues__changedFilterFormValues: Set todefaultFormValuesinstead of{}so the subsequent form submit triggers search with correct defaultsisFieldsFilterEmptynow computed fromdefaultFormValuesrather than hardcodedtrueBoth
isLookupand non-isLookupbranches are covered. When nosearchable_defaultis configured, behavior is unchanged (defaultFormValuesis{}).Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
registry.npmmirror.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /usr/local/bin/yarn install(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.