You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi team, we’re using DataView + DataViewToolbar + DataViewFilters. When a user clicks “Clear all filters”, we want the attribute dropdown (in DataViewFilters) to reset to the first filter (our Name/URL) instead of staying on the last interacted attribute.
Right now, we’re nudging React to remount the first child by bumping a key on our Name/URL filter after clear. This works but is fragile/hacky.
Current Behavior
actual.mp4
Expected Behavior
expected.mp4
Our Proposal
We have a couple of ideas on how to make this work more smoothly for everyone. We'd love to hear your thoughts on either of these solutions:
Make it the default. We think it would be great if DataViewFilters simply reset to the first attribute whenever filters are cleared. It’s what most users would expect, and it would save a lot of people from having to implement their own workarounds.
Introduce a new prop. What if we added an optional prop like defaultActiveFilterId? This would give developers the flexibility to explicitly set the default attribute, both on the initial load and after filters are cleared.
Hi team, we’re using
DataView+DataViewToolbar+DataViewFilters. When a user clicks “Clear all filters”, we want the attribute dropdown (inDataViewFilters) to reset to the first filter (our Name/URL) instead of staying on the last interacted attribute.Right now, we’re nudging React to remount the first child by bumping a key on our Name/URL filter after clear. This works but is fragile/hacky.
Current Behavior
actual.mp4
Expected Behavior
expected.mp4
Our Proposal
We have a couple of ideas on how to make this work more smoothly for everyone. We'd love to hear your thoughts on either of these solutions:
DataViewFilterssimply reset to the first attribute whenever filters are cleared. It’s what most users would expect, and it would save a lot of people from having to implement their own workarounds.defaultActiveFilterId? This would give developers the flexibility to explicitly set the default attribute, both on the initial load and after filters are cleared.Thanks so much for considering our suggestions!