react-data-grid
react-data-grid copied to clipboard
fix: disable sorting of rows from header if interacting with input elements
fixes this issue
how to recreate the bug -
- let's say you're putting an input element in
HeaderCellcomponent - 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
onSortfunction inHeaderCellcomponent