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

Columns are sorted when space key is down during typing in filters

Open Kosssma opened this issue 1 year ago • 2 comments

Describe the bug

When user type key word in filter when he hit space instead of space char as next sign he trigger column sorting functionality. User can not enter space from keyboard, he can only paste it into filter to be able to use it.

To Reproduce

  1. Create a header with a filter like the the [Header filters](example https://adazzle.github.io/react-data-grid/#/header-filters)
  2. Enable sorting like in the [Columns reordering[(example https://adazzle.github.io/react-data-grid/#/columns-reordering)

Link to code example:

Expected behavior

when typing in filter sign user hit space this should not trigger column sorting

Environment

  • react-data-grid version: ^7.0.0-beta.44
  • react/react-dom version: ^18.2.0

Additional context

code line responsible for effect: https://github.com/adazzle/react-data-grid/blob/b667cec545666308ec59d74580b695e344380379/src/HeaderCell.tsx#L280 https://github.com/adazzle/react-data-grid/blob/9aa46269793cda576f60d2c6fb03d250028444a3/src/HeaderCell.tsx#L202

Kosssma avatar Jun 24 '24 11:06 Kosssma