material-react-table-narender 2.13.9 → 2.13.11

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -526,7 +526,7 @@ const openEditingCell = ({ cell, table, }) => {
526
526
  }
527
527
  };
528
528
  const cellKeyboardShortcuts = ({ cell, cellElements, cellValue, containerElement, event, header, parentElement, table, }) => {
529
- var _a, _b, _c, _d, _e, _f, _g, _h;
529
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
530
530
  debugger;
531
531
  if (!table.options.enableKeyboardShortcuts)
532
532
  return;
@@ -582,6 +582,35 @@ const cellKeyboardShortcuts = ({ cell, cellElements, cellValue, containerElement
582
582
  event.preventDefault();
583
583
  header.column.toggleSorting();
584
584
  }
585
+ else if ("Enter" === event.key) {
586
+ debugger;
587
+ event.preventDefault();
588
+ const input = currentCell.querySelector('input');
589
+ const select = currentCell.querySelector('select');
590
+ const checkbox = currentCell.querySelector('input[type="checkbox"]');
591
+ const button = currentCell.querySelector('button');
592
+ const autocomplete = currentCell.querySelector('.MuiAutocomplete-root input[type="text"]');
593
+ // Focus the appropriate element
594
+ if (autocomplete) {
595
+ autocomplete.focus();
596
+ (_j = autocomplete.select) === null || _j === void 0 ? void 0 : _j.call(autocomplete);
597
+ }
598
+ else if (input) {
599
+ input.focus();
600
+ (_k = input.select) === null || _k === void 0 ? void 0 : _k.call(input);
601
+ }
602
+ else if (select) {
603
+ select.focus();
604
+ }
605
+ else if (checkbox) {
606
+ checkbox.focus();
607
+ // checkbox.click();
608
+ }
609
+ else if (button) {
610
+ button.focus();
611
+ // button.click();
612
+ }
613
+ }
585
614
  }
586
615
  else if ([
587
616
  'ArrowRight',