MCPcopy Create free account
hub / github.com/bvaughn/react-window / onKeyDown

Function onKeyDown

lib/core/useScrollToIndex.ts:192–206  ·  view source on GitHub ↗
(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

190 if (!target) return;
191
192 const onKeyDown = (event: KeyboardEvent) => {
193 switch (event.key) {
194 case "ArrowUp":
195 case "ArrowDown":
196 case "ArrowLeft":
197 case "ArrowRight":
198 case "PageUp":
199 case "PageDown":
200 case "Home":
201 case "End":
202 case " ": {
203 cancelScroll();
204 }
205 }
206 };
207
208 target.addEventListener("wheel", cancelScroll, { passive: true });
209 target.addEventListener("touchstart", cancelScroll, { passive: true });

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected