File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/grid/x-data-grid/src/utils Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ export const isHomeOrEndKeys = (key: string): boolean => key === 'Home' || key =
13
13
export const isPageKeys = ( key : string ) : boolean => key . indexOf ( 'Page' ) === 0 ;
14
14
export const isDeleteKeys = ( key : string ) => key === 'Delete' || key === 'Backspace' ;
15
15
16
- const printableCharRegex = / ^ ( \p{ L} | \p{ M} \p{ L} | \p{ M} | \p{ N} | \p{ Z} | \p{ S} | \p{ P} ) $ / iu;
17
- export const isPrintableKey = ( key : string ) => printableCharRegex . test ( key ) ;
16
+ // Non printable keys have a name, e.g. "ArrowRight", see the whole list:
17
+ // https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
18
+ export const isPrintableKey = ( key : string ) => key . length === 1 ;
18
19
19
20
export const GRID_MULTIPLE_SELECTION_KEYS = [ 'Meta' , 'Control' , 'Shift' ] ;
20
21
export const GRID_CELL_EXIT_EDIT_MODE_KEYS = [ 'Enter' , 'Escape' , 'Tab' ] ;
You can’t perform that action at this time.
0 commit comments