fix(iptv): keep remote focus inside the playlist dialog after typing - #764
Merged
ProdigyV21 merged 4 commits intoSep 27, 2026
Merged
Conversation
On a remote, closing the on-screen keyboard with Done or Back cleared the text field's focus without putting it anywhere. The highlight vanished and the next OK landed on the full-screen scrim (or a button drawn as unfocused), which dismissed the dialog with everything typed. Reported on Fire TV, where the full-screen Amazon keyboard is usually left this way; the D-pad exits from a field already brought the focus back. - Done and Back in a field return the focus to the dialog, the same way the D-pad exits do. - hideKeyboardAll() focuses the dialog on TV instead of the activity view behind it. - The scrim (and outside clicks) only dismiss on devices with a touchscreen; without one it is no longer a focus target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017zSZCHkFmK8fgB2UhxpmX4
Owner
|
Thanks for fixing this remote-focus path. I added a guard for late native keyboard callbacks and an on-device regression test. All 9 IPTV dialog tests passed on a TV emulator, including typing into the guide field, pressing Done, then navigating to Save with the D-pad. Play and Sideload Kotlin compilation also passed. Merging with your original commits preserved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reported on Discord ("IPTV Unusable on Android TV") and r/ARVIO: on a Fire TV Stick the Add Playlist dialog closes on its own after typing M3U/Xtream details, so no playlist can be added. A second user: "after entering the details, the active button disappears". It works on an emulator with a mouse and on Google TV / Shield.
Cause
In
IptvPlaylistModal, the D-pad exits of a text field callclearFocus()and thenmodalFocusRequester.requestFocus(). The keyboard's Done action and the Back key only callclearFocus(). Focus then goes to whatever Compose finds first. The full-screen scrim isclickable, so on a remote it is a focus target, and OK on it runsonDismiss. The highlight disappears (the dialog draws it from its own row state), and the next OK throws away everything typed. The full-screen Amazon keyboard on Fire TV is usually left with Done or Back, so Fire TV users hit this every time.Also,
hideKeyboardAll()calledview.requestFocus()on aLocalViewread outsideDialog {}, i.e. the activity's view behind the dialog.Change (1 file, +48/-12)
onKeyboardClosedcallback that returns focus to the dialog, the same way the D-pad exits already do (all eleven TV-layout fields; the touch layout passes nothing).hideKeyboardAll()focuses the dialog on TV instead of the activity view.dismissOnClickOutsideonly dismiss on devices with a touchscreen (LocalHasTouchScreen). Phones and tablets keep tap-outside-to-close.Testing
testSideloadDebugUnitTest: 1828 tests, 0 failures.EditTextinside anAndroidView, which the Compose test APIs cannot drive (pressImeActionButtononly works on Compose text fields).Not in this PR
ModalScriminSettingsScreen.kt(e.g. quality filter editor, cloud e-mail/password) andAppUpdateModal.ktuse the same clickable scrim, so the same focus trap may exist there on TV. Left out to keep this PR small.created by Claude (Anthropic) on behalf of @ReichiMD