fix(virtual_list): Soportar key repeat con navKeyPressed

Cambiar de keyPressed() a navKeyPressed() permite que mantener
pulsada la flecha arriba/abajo mueva la selección continuamente.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
R.Eugenio 2025-12-23 13:12:54 +01:00
parent 206a997628
commit edba1cc7e5

View file

@ -464,18 +464,17 @@ fn handleKeyboard(
_ = provider; _ = provider;
_ = result; _ = result;
if (ctx.input.keyPressed(.up)) { // Usar navKeyPressed() para soportar key repeat (tecla mantenida pulsada)
list_state.moveUp(); if (ctx.input.navKeyPressed()) |key| {
} else if (ctx.input.keyPressed(.down)) { switch (key) {
list_state.moveDown(visible_rows); .up => list_state.moveUp(),
} else if (ctx.input.keyPressed(.page_up)) { .down => list_state.moveDown(visible_rows),
list_state.pageUp(visible_rows); .page_up => list_state.pageUp(visible_rows),
} else if (ctx.input.keyPressed(.page_down)) { .page_down => list_state.pageDown(visible_rows, total_rows),
list_state.pageDown(visible_rows, total_rows); .home => list_state.goToStart(),
} else if (ctx.input.keyPressed(.home)) { .end => list_state.goToEnd(visible_rows, total_rows),
list_state.goToStart(); else => {},
} else if (ctx.input.keyPressed(.end)) { }
list_state.goToEnd(visible_rows, total_rows);
} }
} }