@economic/taco 2.70.2-search-race-condition.0 → 2.70.2-search-race-condition.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/taco.cjs CHANGED
@@ -36573,31 +36573,33 @@ function useTableShortcutsListener(table, tableRef, shortcuts, localShortcuts =
36573
36573
  const globalHandlers = [];
36574
36574
  if (shortcuts && shortcutKeys.length && meta.rowActive.rowActiveIndex !== void 0) {
36575
36575
  const rowActive = rows[meta.rowActive.rowActiveIndex];
36576
- shortcutKeys.forEach((key) => {
36577
- const handler = shortcuts[key];
36578
- let keyDownHandler;
36579
- let keyDownHandlerOptions;
36580
- if (typeof handler === "function") {
36581
- keyDownHandler = handler;
36582
- keyDownHandlerOptions = {
36583
- key
36584
- };
36585
- } else {
36586
- const handlerObject = handler;
36587
- keyDownHandler = handlerObject.handler;
36588
- keyDownHandlerOptions = {
36589
- key,
36590
- meta: handlerObject.meta,
36591
- shift: handlerObject.shift
36592
- };
36593
- }
36594
- globalHandlers.push(
36595
- createShortcutKeyDownHandler(keyDownHandlerOptions, (event) => {
36596
- event.preventDefault();
36597
- keyDownHandler(rowActive == null ? void 0 : rowActive.original);
36598
- })
36599
- );
36600
- });
36576
+ if (rowActive) {
36577
+ shortcutKeys.forEach((key) => {
36578
+ const handler = shortcuts[key];
36579
+ let keyDownHandler;
36580
+ let keyDownHandlerOptions;
36581
+ if (typeof handler === "function") {
36582
+ keyDownHandler = handler;
36583
+ keyDownHandlerOptions = {
36584
+ key
36585
+ };
36586
+ } else {
36587
+ const handlerObject = handler;
36588
+ keyDownHandler = handlerObject.handler;
36589
+ keyDownHandlerOptions = {
36590
+ key,
36591
+ meta: handlerObject.meta,
36592
+ shift: handlerObject.shift
36593
+ };
36594
+ }
36595
+ globalHandlers.push(
36596
+ createShortcutKeyDownHandler(keyDownHandlerOptions, (event) => {
36597
+ event.preventDefault();
36598
+ keyDownHandler(rowActive.original);
36599
+ })
36600
+ );
36601
+ });
36602
+ }
36601
36603
  }
36602
36604
  globalHandlers.forEach((handler) => {
36603
36605
  listenerTarget == null ? void 0 : listenerTarget.addEventListener("keydown", handler);