Skip to content

Can't select text when readOnly to true #2518

Closed
@david-dkp

Description

@david-dkp

Have you checked for an existing issue?

Flutter Quill Version

11.0.1

Steps to Reproduce

Create a readonly QuillEditor like so:

class _ShowTextState extends State<ShowText> {
  late final QuillController _controller = QuillController(
      document: Document.fromDelta(widget.doc),
      readOnly: true,
      selection: const TextSelection.collapsed(offset: 0));

  @override
  Widget build(BuildContext context) {
    return Container(
      constraints: const BoxConstraints(minHeight: 200),
      decoration: BoxDecoration(
        border: Border.all(color: context.theme.colorScheme.outlineVariant),
        borderRadius: BorderRadius.circular(32),
      ),
      width: double.maxFinite,
      padding: const EdgeInsets.all(16),
      child: QuillEditor(
        scrollController: ScrollController(),
        config: const QuillEditorConfig(
          showCursor: false,
          autoFocus: false,
        ),
        focusNode: FocusNode(),
        controller: _controller,
      ),
    );
  }
}

Expected results

I expect the text to be selectable even if it's on readOnly mode.

Actual results

20250319-1604-46.8447278.mp4

Additional Context

Not working on web and Android, not tested in IOS.

The text is not selectable when readOnly is set to true.

20250319-1604-46.8447278.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmajorSignificant impact on the user experience or performance. This issue should be addressed in the nextregressionFor issues where a previously working feature is now broken due to recent changes.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions