Android: Disable selection ActionMode without visual flash (Dialog-safe)#634
Open
NavCore wants to merge 17 commits intoMohamedRejeb:mainfrom
Open
Android: Disable selection ActionMode without visual flash (Dialog-safe)#634NavCore wants to merge 17 commits intoMohamedRejeb:mainfrom
NavCore wants to merge 17 commits intoMohamedRejeb:mainfrom
Conversation
…events the platform selection toolbar (ActionMode: cut/copy/paste) from being shown while keeping editing, cursor, and selection handles functional. This is useful for apps that want custom in-editor controls and no system toolbar. Default behavior remains unchanged (disabled by default).
- Avoid Android-only APIs in commonMain (fixes JitPack/KMP metadata build) - Add expect/actual ProvideNoSelectionToolbar wrapper - Android uses LocalTextToolbar no-op, other targets are pass-through
JitPack does not provide signing credentials, which caused the Android publication task to fail during release builds. This change disables signing for Android publications when credentials are not available, allowing the library to be successfully built and published by JitPack. No runtime or API changes are introduced.
…l flash - Intercept Android ActionMode at Window level for RichTextEditor - Provide NoOp ActionMode with empty Menu to prevent cut/copy/paste UI - Apply fix only when disableSelectionToolbar = true - Keep default behavior unchanged when flag is false - No AppCompat dependency, Android-only implementation - Works correctly inside Compose Dialogs (DialogWindowProvider)
- add minHeight and maxHeight params to RichTextEditor wrappers - remove hardcoded TextFieldDefaults.MinHeight from modifiers - apply heightIn() so editor can be sized relative to parent
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
When using RichTextEditor inside a Compose Dialog on Android, setting
disableSelectionToolbar = truehides the cut/copy/paste toolbar,but the Android ActionMode still appears briefly (one-frame flash)
before being dismissed.
This happens because the ActionMode is created at the Window level
before Compose can suppress it.
Solution
This PR introduces an Android-only fix that fully intercepts ActionMode
creation at the Window level:
onWindowStartingActionMode(...)disableSelectionToolbar = trueKey Points
Files Changed
ProvideNoSelectionToolbar.android.ktResult
Cut / copy / paste toolbar is completely disabled
with zero visual artifacts, even on long-press or word selection.
Thanks for the great library!
This fix enables clean read-only / note-taking use cases on Android.