icflorescu / mantine-datatable

The table component for your Mantine data-rich applications, supporting asynchronous data loading, column sorting, custom cell data rendering, context menus, nesting, Gmail-style batch row selection, dark theme, and more.
https://icflorescu.github.io/mantine-datatable/
MIT License
950 stars 68 forks source link

Checkbox inside filter Popover does not work #481

Closed AtefBellaaj closed 11 months ago

AtefBellaaj commented 11 months ago

Describe the bug Checkboxes do not work in filter.

To Reproduce Steps to reproduce the behavior:

  1. add a checkbox as a filter component in columns defintion.
  2. add a state to control the checkbox
  3. Click on check box
  4. nothing happens...

Expected behavior The checkbox should work properly

Screenshots image

Desktop (please complete the following information):

Additional context Since the filter uses a Mantine PopOver, i reproduced the error with a simple popover and a checkbox somewhere else. To reproduce the error, just add (like in the datatable code pase) add onClick={(e) => e.preventDefault()}. I think this is the source of the problem. line of code

icflorescu commented 11 months ago

Thanks a lot for bringing this to my attention. The issue should be fixed in the latest version, check the age column filter on this example: https://icflorescu.github.io/mantine-datatable/examples/searching-and-filtering.

Can't remember exactly, but I assume the onClick={(e) => e.preventDefault()} was there to prevent accidentally triggering the sort when clicking inside the popup. Should have used .stopPropagation() instead.

AtefBellaaj commented 11 months ago

Awsome. You are very, welcome. Thank you for sharing this awesome library.