Repository navigation
[PWA] Duplicate “Copy” action shown when SelectionArea wraps — double copy menu #175114
Copy link
Copy link
Closed
Closed
Copy link
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listbrowser: safari-iosonly manifests in Safari on iOSonly manifests in Safari on iOSc: parityWorks on one platform but not anotherWorks on one platform but not anotherf: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 3.35Found to occur in 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37Found to occur in 3.37frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesplatform-webWeb applications specificallyWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Description
Steps to reproduce
- Create a new Flutter app (flutter create).
- Replace lib/main.dart with the snippet below.
- Run on Web (PWA or plain web):
- flutter run -d web-server
- Open server with emulator
- Select the text via mouse drag (or long-press on touch).
- Observe the context/selection actions contain two “Copy” entries.
Expected results
Only one “Copy” action appears in the selection controls / context menu.
Actual results
Two “Copy” actions are shown for the same selection on PWA
Code sample
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) => MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('ListView with SelectionArea')),
body: ListView.builder(
itemCount: 20,
itemBuilder:
(context, index) => SelectionArea(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Item ${index + 1}',
style: const TextStyle(fontSize: 18),
),
),
),
),
),
);
}Screenshots or Video
Video demonstration PWA [BUG, not working properly]
Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-09-09.at.11.12.17.mp4
Video demonstration IOS [works fine]
Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-09-09.at.11.10.23.mp4
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.35.3, on macOS 15.6.1 24G90 darwin-arm64, locale ru-RU) [259ms]
• Flutter version 3.35.3 on channel stable at /Users/maga/fvm/versions/stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a402d9a437 (5 days ago), 2025-09-03 14:54:31 -0700
• Engine revision ddf47dd3ff
• Dart version 3.9.2
• DevTools version 2.48.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [1 187ms]
• Android SDK at /Users/maga/Library/Android/sdk
• Emulator version 35.6.11.0 (build_id 13610412) (CL:N/A)
• Platform android-36, build-tools 36.0.0
• Java binary at: /opt/homebrew/Cellar/openjdk@17/17.0.15/libexec/openjdk.jdk/Contents/Home/bin/java
This JDK is specified in your Flutter configuration.
To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment Homebrew (build 17.0.15+0)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [806ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16F6
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [8ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2025.1) [7ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.6+-13391695-b895.109)
[✓] VS Code (version 1.103.2) [6ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.118.0
[✓] Connected device (3 available) [5,9s]
• iPhone 16 Plus (mobile) • 667BE1F0-E3BD-455A-A6CA-603D3560D8E9 • ios • com.apple.CoreSimulator.SimRuntime.iOS-18-6 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.6.1 24G90 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 139.0.7258.155
[✓] Network resources [366ms]
• All expected network resources are available.
• No issues found!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listbrowser: safari-iosonly manifests in Safari on iOSonly manifests in Safari on iOSc: parityWorks on one platform but not anotherWorks on one platform but not anotherf: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 3.35Found to occur in 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37Found to occur in 3.37frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesplatform-webWeb applications specificallyWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Activity
tirth-patel-nc commentedon Sep 9, 2025
Thanks for the report. Seeing the same behaviour with latest SDK versions on Web (iOS). Tested on Safari.
Chrome on android appears to work fine.
mdebbar commentedon Oct 1, 2025
This is likely a browser context menu + flutter context menu showing up.
We've always had the flutter context menu disabled on web, but I think that was done in an era where all text selection was handled in
EditableText:flutter/packages/flutter/lib/src/widgets/editable_text.dart
Lines 4960 to 4962 in 7ceee3b
Now we have more places that show a toolbar. Some of them skip toolbar on the web, e.g:
flutter/packages/flutter/lib/src/widgets/selectable_region.dart
Lines 1360 to 1362 in 7ceee3b
But some of them don't:
flutter/packages/flutter/lib/src/widgets/selectable_region.dart
Line 1128 in 40f013a
I haven't confirmed that this is the callsite that's causing the bug, but looking at the video I see the flutter toolbar shows up when handle drag is complete. So I strongly suspect this is culprit.
Is there a better way to solve this once and for all? cc @loic-sharma @Renzo-Olivares
`SelectableRegion` should not show flutter rendered context menu when…
github-actions commentedon Oct 30, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.`SelectableRegion` should not show flutter rendered context menu when…