@tanstack/solid-hotkeys 0.20.0 → 0.21.0

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.
@@ -1,4 +1,5 @@
1
1
  import { useAppHotkeysStoreSource, useDefaultHotkeysOptionsSource } from "./defaultOptions.js";
2
+ import { delegateEvents } from "solid-js/web";
2
3
  import { createEffect, onCleanup, untrack } from "solid-js";
3
4
  import { createHotkeyBindings, prepareHotkeyDefinitions } from "@tanstack/hotkeys/adapter";
4
5
 
@@ -24,7 +25,7 @@ import { createHotkeyBindings, prepareHotkeyDefinitions } from "@tanstack/hotkey
24
25
  function createHotkeys(hotkeys, commonOptions = {}) {
25
26
  const defaultOptions = useDefaultHotkeysOptionsSource();
26
27
  const appHotkeys = useAppHotkeysStoreSource();
27
- const bindings = createHotkeyBindings();
28
+ const bindings = createHotkeyBindings({ afterDelegatedHandlers: true });
28
29
  onCleanup(() => bindings.destroy());
29
30
  createEffect(() => {
30
31
  appHotkeys.state();
@@ -34,6 +35,7 @@ function createHotkeys(hotkeys, commonOptions = {}) {
34
35
  commonOptions: typeof commonOptions === "function" ? commonOptions() : commonOptions,
35
36
  resolveTarget: (target) => target
36
37
  });
38
+ delegateEvents(["keydown", "keyup"]);
37
39
  untrack(() => bindings.update(definitions));
38
40
  });
39
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-hotkeys",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "SolidJS adapter for TanStack Hotkeys",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  "skills"
39
39
  ],
40
40
  "dependencies": {
41
- "@tanstack/hotkeys": "0.23.0"
41
+ "@tanstack/hotkeys": "0.24.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@solidjs/testing-library": "^0.8.10",