Skip to content

Decouple TextToolbarStatus from iOS context menu visibility#3139

Draft
Vladimir Mazunin (mazunin-v-jb) wants to merge 4 commits into
jb-mainfrom
v.mazunin/context-menu-hiding-after-back-gesture-fix
Draft

Decouple TextToolbarStatus from iOS context menu visibility#3139
Vladimir Mazunin (mazunin-v-jb) wants to merge 4 commits into
jb-mainfrom
v.mazunin/context-menu-hiding-after-back-gesture-fix

Conversation

@mazunin-v-jb

@mazunin-v-jb Vladimir Mazunin (mazunin-v-jb) commented Jun 19, 2026

Copy link
Copy Markdown

Decouple TextToolbarStatus from the native context menu on iOS visibility to fix leaks and incorrect behavior.
Clean ups in the UIKitTextInputService.ios.kt

Since the TextToolbar.status was tied with isEditingMenuShow flag, during back navigation there might be cases when TextToolbar.status reports as Hidden while the menu repositioning is happening on the CMPEditMenuView side.
That's why SelectionManager doesn't call TextToolbar.hide() (as it should during the back-navigating teardown), and the menu reappears once again, leaking the ComposeTextInputView in the view hierarchy.

Fixes: CMP-9316 [ios]. context menu doesn't hide after backNavigation

Testing

Should be tested by QA, the case in the attached task

Release Notes

Fixes - iOS

  • Fix the context menu lingering on screen after navigating back from a SelectionContainer

…ix leaks and incorrect behavior.

Fixed zombie ComposeTextInputView after navigating back when context menu is shown on SelectionContainer
Clean ups in the UIKitTextInputService.ios.kt

@ASalavei Andrei Salavei (ASalavei) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case: we propagated isEditMenuShown because the edit menu can hide by itself (for instance when user taps outside the context menu) - in this case it's highly possible to have misaligned status: TextToolbarStatus with the real visibility of the context menu.

Please verify it won't be an issue in the standard use-case, like operating with Text Fields.

@mazunin-v-jb Vladimir Mazunin (mazunin-v-jb) marked this pull request as draft June 22, 2026 16:01
@mazunin-v-jb

Vladimir Mazunin (mazunin-v-jb) commented Jun 22, 2026

Copy link
Copy Markdown
Author

in this case it's highly possible to have misaligned status: TextToolbarStatus with the real visibility of the context menu.

Yes, I've found a regression after textfields retesting unfortunately
Not sure if this is the root cause for the issue though
Investigating, changed it to the draft

@mazunin-v-jb

Copy link
Copy Markdown
Author

Looks like the regression isn't caused by changes here.
But I'll keep this in a draft until it is fixed

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.

3 participants