Conversation
d1cd25d to
e4fefcf
Compare
rock3r
reviewed
Dec 3, 2025
...on/foundation/src/desktopMain/kotlin/androidx/compose/foundation/text/ContextMenu.desktop.kt
Outdated
Show resolved
Hide resolved
Comment on lines
-188
to
-196
| private fun SemanticsNodeInteraction.assertMenuItemDoesNotExistOrIsDisabled() { | ||
| // New context menus disabled items; old context menus don't show disabled items. | ||
| if (ComposeFoundationFlags.isNewContextMenuEnabled) { | ||
| assertIsNotEnabled() | ||
| } else { | ||
| assertDoesNotExist() | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
I think you'll still need this if you add tests for the "hide disabled items" menu, which seem to be missing
Author
There was a problem hiding this comment.
contextMenuArea disables or removes copy action for SelectionContainer with empty selection tests this once, but since the default behavior is now to disable the menu item, there's no need for this function (and also the behavior no longer depends on isNewContextMenuEnabled, but on LocalTextContextMenu).
…nager.textManager`
igordmn
reviewed
Dec 3, 2025
...on/foundation/src/desktopMain/kotlin/androidx/compose/foundation/text/ContextMenu.desktop.kt
Outdated
Show resolved
Hide resolved
...foundation/src/desktopMain/kotlin/androidx/compose/foundation/ContextMenuProvider.desktop.kt
Outdated
Show resolved
Hide resolved
...foundation/src/desktopMain/kotlin/androidx/compose/foundation/ContextMenuProvider.desktop.kt
Outdated
Show resolved
Hide resolved
igordmn
approved these changes
Dec 4, 2025
Collaborator
igordmn
left a comment
There was a problem hiding this comment.
Needs a second approval
Author
|
terrakok
approved these changes
Dec 8, 2025
Member
terrakok
left a comment
There was a problem hiding this comment.
It seems OK for me, but I'm far from Desktop target API and specifics
MatkovIvan
approved these changes
Dec 8, 2025
This was referenced Dec 8, 2025
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.
TextContextMenucan now create disabled menu items viaContextMenuItemWithEnabledStateand they will be shown as such in the context menu.The default
TextContextMenuimplementation (TextContextMenu.Default) utilizes this to disable, rather than remove irrelevant menu items. For example, when there is no selection in a text field, the "Copy" menu item will be disabled rather than hidden.To get the previous behavior where the irrelevant item is hidden, use
TextContextMenu.HideDisabledMenuItemslike so:Note that this is all relevant only for the old text context menus (when
ComposeFoundationFlags.isNewContextMenuEnabledisfalse).Fixes https://youtrack.jetbrains.com/issue/CMP-9329
Fixes https://youtrack.jetbrains.com/issue/CMP-9342
Testing
Added unit tests and also tested manually
This should be tested by QA
Release Notes
Fixes - Desktop
SelectionContainer, the "Copy" menu item will be disabled.Features - Desktop
SelectionContainercan now be disabled.