admin icon indicating copy to clipboard operation
admin copied to clipboard

After applying a saved filter using the chip, again clicking the same does not unselect the filter

Open ymaheshwari1 opened this issue 3 years ago • 3 comments

Steps to reproduce:

  • Go to a page where we have a saved filter (like the order page)
  • Select a saved filter
  • Click the same filter again, but it does not unselect the filter

Screenshot: Screenshot (181)_LI

ymaheshwari1 avatar Jul 16 '22 16:07 ymaheshwari1

Thanks for reporting it in! Issue has been included in our backlog :)

olivermrbl avatar Jul 17 '22 13:07 olivermrbl

Just some context for where this issue arises and should be solved. In the order-filter-dropdown/index.tsx an eventhandler (handleTabClick) is responsible alerting the filter context of a change in tabs. If the tabname passed along is the active tab we should deselect rather than re-apply. wdyt @olivermrbl?

Please drop a comment if you want to work on this 😄

pKorsholm avatar Aug 03 '22 06:08 pKorsholm

Just some context for where this issue arises and should be solved. In the order-filter-dropdown/index.tsx an eventhandler (handleTabClick) is responsible alerting the filter context of a change in tabs. If the tabname passed along is the active tab we should deselect rather than re-apply. wdyt @olivermrbl?

Please drop a comment if you want to work on this 😄

Should we instead think of making the default available filters (https://github.com/medusajs/admin/blob/d79c68cf9a533741434aaff21c1adaa35f113ee2/src/components/templates/order-table/use-order-filters.ts#L355) removeable, by adding removable: true only after the filter gets selected?

I'm thinking this as when creating a new filter we make it removable and thus adds a close icon so the user knows that we can remove this filter, so in the same way the user will have a close icon for the default filters as well

ymaheshwari1 avatar Aug 03 '22 06:08 ymaheshwari1