Skip to content

[BUG] - Links are not clickable on mobile #2851

@Hannnes1

Description

@Hannnes1

Package Version
super_editor 0.3.0-dev.40

User Info
Solid Red AB

To Reproduce
Steps to reproduce the behavior:

  1. Run the example below on iOS or Android
  2. Click link
  3. Nothing happens

Minimal Reproduction Code

Minimal, Runnable Code Sample
import 'package:flutter/material.dart';
import 'package:super_editor/super_editor.dart';

void main() {
runApp(const MainApp());
}

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

@override
Widget build(BuildContext context) {
  return MaterialApp(
    home: _HomePage(),
  );
}
}

class _HomePage extends StatefulWidget {
const _HomePage();

@override
State<_HomePage> createState() => __HomePageState();
}

class __HomePageState extends State<_HomePage> {
late final MutableDocument _document;
late final MutableDocumentComposer _composer;
late final Editor _editor;

@override
void initState() {
  super.initState();

  _document = MutableDocument(
    nodes: [
      ParagraphNode(
        id: Editor.createNodeId(),
        text: AttributedText(
          'Example text',
          AttributedSpans(
            attributions: [
              SpanMarker(
                attribution: LinkAttribution('https://example.com'),
                offset: 0,
                markerType: SpanMarkerType.start,
              ),
              SpanMarker(
                attribution: LinkAttribution('https://example.com'),
                offset: 6,
                markerType: SpanMarkerType.end,
              ),
            ],
          ),
        ),
      ),
    ],
  );

  _composer = MutableDocumentComposer();

  _editor = createDefaultDocumentEditor(document: _document, composer: _composer);
}

@override
Widget build(context) {
  return Scaffold(
    appBar: AppBar(),
    body: SuperEditor(
      editor: _editor,
      componentBuilders: [
        ...defaultComponentBuilders,
        TaskComponentBuilder(_editor),
      ],
    ),
  );
}
}

Actual behavior
Nothing happens when a link is pressed

Expected behavior
The link should be opened.

Platform
iOS, Android

Flutter version
3.38.1

Additional context
Another solution could be to do like for example Google Keep. When a user clicks the link, ask if they want to edit or open the link.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type_bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions