fix(tui): preserve keyboard picker selection

This commit is contained in:
chengyongru
2026-08-21 18:23:04 +08:00
committed by chengyongru
parent 252ea18e88
commit 4561c748f6
2 changed files with 32 additions and 1 deletions
+4 -1
View File
@@ -137,7 +137,10 @@ export class PickerMenu<T> {
? { backgroundColor: RGBA.fromHex(this.theme.selectedBackground) }
: {}),
attributes: selected ? TextAttributes.BOLD : 0,
onMouseOver: () => {
// OpenTUI rechecks hover after rows are rebuilt. Treating that synthetic
// `over` as pointer intent would undo a keyboard move whenever the mouse
// remains over the previously selected row.
onMouseMove: () => {
if (this.selected === index) return
this.selected = index
this.render()