DioxusLabs / DioxusLabs/dioxus

[Android/iOS build] Missing context menu on Android/iOS and native text-selection toolbar

オープン 初心者向け
#5,653 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
bug
主要言語
Rust
スター
39.1k
フォーク
1.9k
平均マージ
4日 10時間
マージ済み PR(30日)
4

説明

**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**

Image

**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,

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

dioxus-desktop の config.rs:117 と、dioxus-mobile の Config::new() または Default 実装から始めます。`dx bundle --platform android --release` でモバイルの release をビルドし、テキスト入力を長押しするとネイティブの切り取り/コピー/貼り付けツールバーが表示されることを確認し、デスクトップのコンテキストメニューの動作に変更がないことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, ios, rust
領域
mobile-dev
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
78/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。