dungeon keybinding HUD: Escape during conflict dialog is not consumed #1074

Closed
opened 2026-08-13 13:30:25 +00:00 by spikerj · 1 comment
Owner

Dungeon KeybindingConfigHUD.handleKeyDown only captures keys while rebindingActionId is set. On a conflicting rebind the HUD clears that id, stores conflictActionId, and shows Swap/Cancel — but handleKeyDown then returns false for every key, including Escape.

The parent close handler can therefore dismiss the whole keybinding modal while the conflict dialog is still on screen. Space-game KeybindingConfigHUD swallows keys when its conflict dialog is visible; dungeon does not.

Repro (unit): enter rebind → onRebind returns { success: false, conflict } → handleKeyDown(Escape) is false.

Related cleanup: dismissing the dialog via Swap/Cancel leaves conflictSwapBtn / conflictCancelBtn pointing at detached meshes (parent === null). Harmless today because handleClick is gated on conflictActionId, but the pointers are only nulled in dispose().

File: projects/spikersoft/src/app/_components/_games/dungeon-crawler/hud/keybinding-config-hud.ts (handleKeyDown / handleConflictClick).

Dungeon `KeybindingConfigHUD.handleKeyDown` only captures keys while `rebindingActionId` is set. On a conflicting rebind the HUD clears that id, stores `conflictActionId`, and shows Swap/Cancel — but `handleKeyDown` then returns `false` for every key, including Escape. The parent close handler can therefore dismiss the whole keybinding modal while the conflict dialog is still on screen. Space-game `KeybindingConfigHUD` swallows keys when its conflict dialog is visible; dungeon does not. Repro (unit): enter rebind → `onRebind` returns `{ success: false, conflict }` → `handleKeyDown(Escape)` is `false`. Related cleanup: dismissing the dialog via Swap/Cancel leaves `conflictSwapBtn` / `conflictCancelBtn` pointing at detached meshes (`parent === null`). Harmless today because `handleClick` is gated on `conflictActionId`, but the pointers are only nulled in `dispose()`. File: `projects/spikersoft/src/app/_components/_games/dungeon-crawler/hud/keybinding-config-hud.ts` (`handleKeyDown` / `handleConflictClick`).
Author
Owner

Fixed in spikersoft-angular PR #823 (a0f0ccd9). Closing.

Fixed in `spikersoft-angular` [PR #823](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/823) (`a0f0ccd9`). Closing.
Sign in to join this conversation.