@jsenv/navi 0.29.456 → 0.29.457

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.
@@ -122,6 +122,33 @@ how to detect gets a dev warning naming the detectors that exist. The carrying
122
122
  family and the surface have a file each:
123
123
  [drag_interactions.md](./drag_interactions.md) and [pan_zoom.md](./pan_zoom.md).
124
124
 
125
+ A declared key takes the key: the browser's default for it does not happen as
126
+ well, whether the gate lets it through or refuses it. On a field this includes
127
+ the field's own keys — the caret, typing — so a text field can say what its
128
+ arrows do, through the same gate as a number field's:
129
+
130
+ ```jsx
131
+ const step = (event, seconds) => {
132
+ const input = findEvent(event, "keydown").target;
133
+ const next = formatTime(parseTime(input.value) + seconds);
134
+ dispatchRequestSetUIState(input, next, { event });
135
+ };
136
+
137
+ <Input
138
+ value={formatTime(start)}
139
+ interactions={{
140
+ "keyboard:arrowup": (event) => step(event, 1),
141
+ "keyboard:arrowdown": (event) => step(event, -1),
142
+ "keyboard:shift+arrowup": (event) => step(event, 60),
143
+ "keyboard:shift+arrowdown": (event) => step(event, -60),
144
+ }}
145
+ />;
146
+ ```
147
+
148
+ A shortcut is matched with its exact modifiers, so Shift is a key of its own.
149
+ Keys declared on something around a field — a list item, a row — leave the
150
+ field inside every key it has a use for.
151
+
125
152
  ## Which interaction asked
126
153
 
127
154
  An interaction navi makes is **dispatched as an event of its own name** —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.456",
3
+ "version": "0.29.457",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {