material-react-table-narender 2.13.6 → 2.13.7

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -594,15 +594,25 @@ const cellKeyboardShortcuts = ({ cell, cellElements, cellValue, containerElement
594
594
  'PageDown',
595
595
  ].includes(event.key)) {
596
596
  event.preventDefault();
597
- if (['ArrowDown'].includes(event.key)) {
598
- debugger; // This will pause execution for debugging purposes
599
- // Select the input element within the MUI Autocomplete component
597
+ // if (['ArrowDown'].includes(event.key)) {
598
+ // debugger; // This will pause execution for debugging purposes
599
+ // // Select the input element within the MUI Autocomplete component
600
+ // const autocomplete = currentCell.querySelector('.MuiAutocomplete-root input[type="text"]');
601
+ // // Check if the current cell is an MUI Autocomplete
602
+ // if (autocomplete) {
603
+ // return; // Exit the function if it's an Autocomplete
604
+ // }
605
+ // // Additional logic for when it's not an Autocomplete can go here
606
+ // }
607
+ if (['ArrowDown', 'ArrowUp'].includes(event.key)) {
600
608
  const autocomplete = currentCell.querySelector('.MuiAutocomplete-root input[type="text"]');
601
- // Check if the current cell is an MUI Autocomplete
602
- if (autocomplete) {
603
- return; // Exit the function if it's an Autocomplete
609
+ // Check if the autocomplete input exists and is focused
610
+ if (autocomplete && document.activeElement === autocomplete) {
611
+ // Do something with the autocomplete input
612
+ console.log('Autocomplete input found and is focused:', autocomplete);
613
+ return; // Exit if it's an Autocomplete and it is focused
604
614
  }
605
- // Additional logic for when it's not an Autocomplete can go here
615
+ // Additional logic if not an Autocomplete or not focused
606
616
  }
607
617
  const currentRow = parentElement || currentCell.closest('tr');
608
618
  const tableElement = containerElement || currentCell.closest('table');