grist-core
grist-core copied to clipboard
Useless filter activation
Hi,
If I click on "Filter Data" while the filter bar is on, and if I press Esc without selecting any value, a filter is still added, with all values selected:
Screencast from 2022-11-02 20-04-31.webm
Not a big deal, but I guess this is not a feature ;)
Yohan
@paulfitz @dsagal
https://user-images.githubusercontent.com/11460746/218441451-d9641744-87b1-4976-aca0-21b97b1c98d5.mov
I succeed at making the filter button disappear, however there is still the change in the filter icon.
Here the observable which dictate the behavior of this icon: https://github.com/gristlabs/grist-core/blob/main/app/client/ui/ViewSectionMenu.ts#L49
Here the property https://github.com/gristlabs/grist-core/blob/main/app/client/models/entities/ViewSectionRec.ts#L435
I suspect the onClose function to save the filters even if there are no modifications. Do you have an idea to solve this issue ?
Actually, let's confirm with @anaisconce first. Some of the automatic filter-pinning behaviors were intentional (to make filters more discoverable). You are probably right about Escape, but I'd like to check. As for implementation the best clue I can suggest is to look at the difference between pressing Escape and clicking Close.
Actually, let's confirm with @anaisconce first. Some of the automatic filter-pinning behaviors were intentional (to make filters more discoverable). You are probably right about Escape, but I'd like to check. As for implementation the best clue I can suggest is to look at the difference between pressing Escape and clicking Close.
Thanks for your answer. The behavior with an escape is the same. I'll wait for @anaisconce suggestion so !
ping @anaisconce :)
Summarizing the thread for @anaisconce to save her some time.
Currently, if a user clicks on Filter Data and then immediately presses Esc without selecting any value, a filter that matches everything is added. This seems undesirable. Ok to change this behavior so that Esc does nothing, as if the user had not clicked on Filter Data at all?
Yes, that is reasonable. Thanks Paul for the summary (and nudge!)