material-react-table-narender 2.13.10 → 2.13.12

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -528,6 +528,11 @@ const openEditingCell = ({ cell, table, }) => {
528
528
  const cellKeyboardShortcuts = ({ cell, cellElements, cellValue, containerElement, event, header, parentElement, table, }) => {
529
529
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
530
530
  debugger;
531
+ if (event.altKey && event.key.toLowerCase() === 'n') {
532
+ event.preventDefault();
533
+ table.options.enableKeyboardShortcuts = !table.options.enableKeyboardShortcuts;
534
+ return;
535
+ }
531
536
  if (!table.options.enableKeyboardShortcuts)
532
537
  return;
533
538
  if (event.isPropagationStopped())
@@ -591,24 +596,24 @@ const cellKeyboardShortcuts = ({ cell, cellElements, cellValue, containerElement
591
596
  const button = currentCell.querySelector('button');
592
597
  const autocomplete = currentCell.querySelector('.MuiAutocomplete-root input[type="text"]');
593
598
  // Focus the appropriate element
594
- if (input) {
599
+ if (autocomplete) {
600
+ autocomplete.focus();
601
+ (_j = autocomplete.select) === null || _j === void 0 ? void 0 : _j.call(autocomplete);
602
+ }
603
+ else if (input) {
595
604
  input.focus();
596
- (_j = input.select) === null || _j === void 0 ? void 0 : _j.call(input);
605
+ (_k = input.select) === null || _k === void 0 ? void 0 : _k.call(input);
597
606
  }
598
607
  else if (select) {
599
608
  select.focus();
600
609
  }
601
610
  else if (checkbox) {
602
611
  checkbox.focus();
603
- checkbox.click();
612
+ // checkbox.click();
604
613
  }
605
614
  else if (button) {
606
615
  button.focus();
607
- button.click();
608
- }
609
- else if (autocomplete) {
610
- autocomplete.focus();
611
- (_k = autocomplete.select) === null || _k === void 0 ? void 0 : _k.call(autocomplete);
616
+ // button.click();
612
617
  }
613
618
  }
614
619
  }