Files
iptvnator/libs/ui
4grayandClaude Opus 4.8 a4f3a5546f fix(epg): don't trigger block playback on Enter from nested buttons
The timeline programme block is `tabindex=0 role=button` and emits `blockClick`
on both click and keydown.enter. The nested watch/info buttons stop the *click*
from bubbling, but not the *keydown* — so a keyboard user who tabs to the info
button on a past catch-up programme and presses Enter fired the block's Enter
handler (→ timeshift playback) before the button's own action opened the dialog.
Flagged by Codex.

Route the block's Enter through `onBlockActivate`, which emits only when the
block itself is the event target (`event.target === event.currentTarget`),
mirroring the mouse `stopPropagation()`. Enter bubbled up from a nested button is
ignored, so keyboard users get the button's action.

Test: asserts Enter on the block activates, Enter bubbled from a child does not.
ui-epg 83 green, lint clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 19:03:04 +02:00
..