Skip to content

[Web] Context menu is not showing on right click #2649

@rodrigo-itao

Description

@rodrigo-itao

Have you checked for an existing issue?

Flutter Quill Version

11.4.2

Steps to Reproduce

Run the following code on Flutter Web:

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_quill/flutter_quill.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  BrowserContextMenu.disableContextMenu();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      localizationsDelegates: const [FlutterQuillLocalizations.delegate],
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  QuillController _controller = QuillController.basic();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.start,
        children: <Widget>[
          Center(
            child: Container(
              width: 300,
              height: 300,
              color: Colors.grey.shade200,
              child: QuillEditor.basic(
                controller: _controller,
                config: const QuillEditorConfig(
                  showCursor: true,
                  autoFocus: true,
                  padding: EdgeInsets.all(20),
                ),
              ),
            ),
          ),
          const SizedBox(height: 100),
          SelectionArea(
            child: Container(
              width: 300,
              height: 300,
              color: Colors.yellow,
              child: Center(child: Text('SELECTABLE TEXT')),
            ),
          ),
        ],
      ),
    );
  }
}

Expected results

When right-clicking the selected text in Flutter Quill, the context menu should appear.

Actual results

The context menu does not appear.

Additional Context

Screenshots / Video demonstration
simplescreenrecorder-2025-09-06_17.32.34.mp4
Logs

flutter doctor -v

[✓] Flutter (Channel stable, 3.35.3, on Ubuntu 24.04.3 LTS 6.8.0-79-generic, locale en_US.UTF-8) [115ms]
    • Flutter version 3.35.3 on channel stable at /home/rodrigo/Documents/flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a402d9a437 (3 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 32.0.0) [238ms]
    • Android SDK at /home/rodrigo/Android/Sdk
    • Emulator version 35.6.11.0 (build_id 13610412) (CL:N/A)
    ✗ cmdline-tools component is missing.
      Try installing or updating Android Studio.
      Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment variable.
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/linux-android-setup for more details.

[✓] Chrome - develop for the web [96ms]
    • Chrome at google-chrome

[✗] Linux toolchain - develop for Linux desktop [352ms]
    ✗ clang++ is required for Linux development.
      It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/
    ✗ CMake is required for Linux development.
      It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/
    • ninja version 1.11.1
    • pkg-config version 1.8.1
    • OpenGL core renderer: AMD Radeon Graphics (radeonsi, raphael_mendocino, LLVM 19.1.1, DRM 3.57, 6.8.0-79-generic) (X11)
    • OpenGL core version: 4.6 (Core Profile) Mesa 25.0.7-0ubuntu0.24.04.1 (X11)
    • OpenGL core shading language version: 4.60 (X11)
    • OpenGL ES renderer: AMD Radeon Graphics (radeonsi, raphael_mendocino, LLVM 19.1.1, DRM 3.57, 6.8.0-79-generic) (X11)
    • OpenGL ES version: OpenGL ES 3.2 Mesa 25.0.7-0ubuntu0.24.04.1 (X11)
    • OpenGL ES shading language version: OpenGL ES GLSL ES 3.20 (X11)
    • GL_EXT_framebuffer_blit: yes (X11)
    • GL_EXT_texture_format_BGRA8888: yes (X11)

[✓] Android Studio (version 2025.1.1) [95ms]
    • Android Studio at /home/rodrigo/Documents/android-studio
    • 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)

[✓] IntelliJ IDEA Community Edition (version 2025.2) [94ms]
    • IntelliJ at /home/rodrigo/Documents/intelli j
    • Flutter plugin version 87.1
    • Dart plugin version 252.25557.23

[✓] VS Code (version 1.103.2) [8ms]
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available) [88ms]
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 24.04.3 LTS 6.8.0-79-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 139.0.7258.154

[✓] Network resources [362ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions