DioxusLabs / DioxusLabs/dioxus

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

Đang mở Phù hợp với người mới
#5,653 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Rust
Star
39.2k
Fork
1.9k
Merge trung bình
4 ngày 10 giờ
Pull request đã merge (30 ngày)
4

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với config.rs:117 của dioxus-desktop và phần triển khai Config::new() hoặc Default của dioxus-mobile. Tạo một bản release mobile bằng `dx bundle --platform android --release`, xác minh rằng việc nhấn giữ một ô nhập văn bản sẽ hiển thị thanh công cụ cắt/sao chép/dán gốc, và xác nhận rằng hành vi của menu ngữ cảnh trên desktop vẫn không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, ios, rust
Lĩnh vực
mobile-dev
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
78/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.