table icon indicating copy to clipboard operation
table copied to clipboard

Dropdown in header fires the sorting fn.

Open AbdallaEmadEldinAbdalla opened this issue 2 years ago • 2 comments

Describe the bug

Dropdown in header fires the sorting fn.

When i press on the header and show the dropdown nothing happens and when i dismiss it also nothing happened but if i choose something from the dropdown like All Time it will fire the sorting. image

Steps to reproduce

Add dropdown menu as header inside accessor and try to select anything from the dropdown it will do sort and select at the same time.

Expected behavior

It should only change the dropdown status and not fire the sort

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

MAC OS chrome

react-table version

8.9.3

TypeScript version

No response

Additional context

No response

Terms & Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

AbdallaEmadEldinAbdalla avatar Sep 26 '23 11:09 AbdallaEmadEldinAbdalla

Just use e.stopPropogation() in your button onClick

KevinVandy avatar Sep 26 '23 12:09 KevinVandy

@KevinVandy using e.stopPropogation() prevent dismissing the dropdown after selecting but it's not preventing the sorting.

AbdallaEmadEldinAbdalla avatar Sep 26 '23 12:09 AbdallaEmadEldinAbdalla