react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

fix: disable sorting of rows from header if interacting with input elements

Open holaChaitanya opened this issue 1 year ago • 0 comments

fixes this issue

how to recreate the bug -

  • let's say you're putting an input element in HeaderCell component
  • this input element was being used for filtering functionality as shown in this example
  • now, you also implemented sorting of rows from the column header
  • when you try to filter out by typing in the input element and put an empty space, this will trigger sorting
  • the above behaviour also occurs when you click inside an input element

fix -

  • checking if the click or keyDown events happened inside an input element, if yes, then not triggering the onSort function in HeaderCell component

holaChaitanya avatar Aug 11 '24 17:08 holaChaitanya