DioxusLabs / DioxusLabs/dioxus
[Android/iOS build] Missing context menu on Android/iOS and native text-selection toolbar
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
**Problem**
`dioxus-desktop` defaults` disable_context_menu = !cfg!(debug_assertions)` (config.rs:117), injecting a global contextmenu → `preventDefault()` script in release builds only.
On Android/iOS, this also suppresses the native `FloatingActionMode `(cut/copy/paste/select-all toolbar) triggered by WebView text selection. Result: no copy/paste toolbar in any Dioxus mobile release APK/IPA.
**Steps To Reproduce**
Steps to reproduce the behavior:
- Create any Dioxus mobile app with a text input
- Build a release APK: dx bundle --platform android --release
- Install and long-press a text input on the device
- The cut/copy/paste/select-all floating toolbar never appears
**Expected behavior**
The native text-selection toolbar (cut/copy/paste/select-all) should appear on long-press in release builds, same as in debug.
**Screenshots**
**Environment:**
- Dioxus version: 0.7.9
- Rust version: 1.91.1
- OS info: Android 15 (API 35)
- App platform: mobile (Android)
**Questionnaire**
I would like to fix and I have a solution.
**Proposed fix**
`disable_context_menu` is a desktop-only concept and should not be inherited by dioxus-mobile's Config default.
The fix is to override it to false in mobile's default config, keeping desktop behavior unchanged:
// dioxus-mobile Config::new() / Default impl
disable_context_menu: false,
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with dioxus-desktop's config.rs:117 and the dioxus-mobile Config::new() or Default implementation. Build a mobile release with `dx bundle --platform android --release`, verify that long-pressing a text input shows the native cut/copy/paste toolbar, and confirm desktop context-menu behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, ios, rust
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100