Skip to content

fix: Escape also closes a menu opened by touch - #65

Merged
compot-dev merged 1 commit into
v2from
fix/menu-escape-touch
Oct 12, 2026
Merged

compot-dev merged 1 commit into
v2from
fix/menu-escape-touch

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

Follow-up to #60, found while device-testing #63.

Symptom: Escape closes the menu when it was opened with OK/Enter, but not when it was opened by tapping the screen.

Cause: a menu opened by touch is in touch mode with no focused view, so key events stop at the popup's decor view and never reach the layout's dispatchKeyEvent, where #60 handles Escape. Back works because the decor view handles it itself.

Fix: the menu layout is focusable in touch mode and takes focus when the menu opens in touch mode. When the menu is opened with a remote (not touch mode), focus stays on the menu items as before.

Device test with the CI build follows.

A menu opened by touch has no focused view, so key events never reached its layout
and Escape did not close it (found while testing #60). In touch mode the layout now
takes focus; with a remote, focus stays on the menu items as before.
@compot-dev

Copy link
Copy Markdown
Collaborator Author

/review

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev

Copy link
Copy Markdown
Collaborator Author

Device test of the CI build on the AG-216 (Android 10):

Menu opened by Escape closes it
tap on the screen ✅ 3/3 (v2: 0/3)
OK on the remote ✅ 2/2

The first OK after touching the screen only leaves touch mode, which is standard Android behaviour and the same as v2; the next OK opens the menu. Remote navigation inside the menu is unchanged.

@compot-dev
compot-dev merged commit ab28e3b into v2 Oct 12, 2026
4 checks passed
@compot-dev
compot-dev deleted the fix/menu-escape-touch branch October 13, 2026 17:16
compot-dev added a commit that referenced this pull request Oct 15, 2026
fix: Escape also closes a menu opened by touch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant