mantine-datatable icon indicating copy to clipboard operation
mantine-datatable copied to clipboard

Checkbox inside filter Popover does not work

Open AtefBellaaj opened this issue 3 years ago • 2 comments

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):

  • OS: Windows 11
  • Browser Chrome :Version 119.0.6045.160 (Official Build) (64-bit)
  • Version Datatable version ^7.1.7

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

AtefBellaaj avatar Nov 26 '23 20:11 AtefBellaaj

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.

icflorescu avatar Dec 21 '23 19:12 icflorescu

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

AtefBellaaj avatar Dec 21 '23 19:12 AtefBellaaj