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:
parent
206a997628
commit
edba1cc7e5
1 changed files with 11 additions and 12 deletions
|
|
@ -464,18 +464,17 @@ fn handleKeyboard(
|
|||
_ = provider;
|
||||
_ = result;
|
||||
|
||||
if (ctx.input.keyPressed(.up)) {
|
||||
list_state.moveUp();
|
||||
} else if (ctx.input.keyPressed(.down)) {
|
||||
list_state.moveDown(visible_rows);
|
||||
} else if (ctx.input.keyPressed(.page_up)) {
|
||||
list_state.pageUp(visible_rows);
|
||||
} else if (ctx.input.keyPressed(.page_down)) {
|
||||
list_state.pageDown(visible_rows, total_rows);
|
||||
} else if (ctx.input.keyPressed(.home)) {
|
||||
list_state.goToStart();
|
||||
} else if (ctx.input.keyPressed(.end)) {
|
||||
list_state.goToEnd(visible_rows, total_rows);
|
||||
// Usar navKeyPressed() para soportar key repeat (tecla mantenida pulsada)
|
||||
if (ctx.input.navKeyPressed()) |key| {
|
||||
switch (key) {
|
||||
.up => list_state.moveUp(),
|
||||
.down => list_state.moveDown(visible_rows),
|
||||
.page_up => list_state.pageUp(visible_rows),
|
||||
.page_down => list_state.pageDown(visible_rows, total_rows),
|
||||
.home => list_state.goToStart(),
|
||||
.end => list_state.goToEnd(visible_rows, total_rows),
|
||||
else => {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue