Skip to content

SelectionArea shows unexpected black line under overflowed text when focused #182776

Closed

Description

@nhh1500

Steps to reproduce

Use the mouse to click on the text or start a selection that includes the text widget, the black will appear.

Expected results

No black line should appear under the text widget when focused.

Actual results

A black line is rendered below the text widget

Code sample

Code sample
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(colorSchemeSeed: Colors.blue),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  final String title;

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

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(widget.title)),
      body: SelectionArea(
        child: ListView.builder(
          itemCount: 5,
          itemBuilder: (context, index) {
            return Text(
                  '''
                                                                  a
                                                                  b
                                                                  c
                                                                  d
                                                                  ''',
                  maxLines: 3,
                  overflow: TextOverflow.fade,
                );
          },
        ),
      ),
    );
  }
}

Screenshots or Video

Image

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.38.7, on Microsoft Windows [Version 10.0.26200.7840], locale en-US)
[√] Windows Version (11 Pro 64-bit, 25H2, 2009)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.1)
[√] Connected device (3 available)
[√] Network resources

Activity

  1. added
    in triagePresently being triaged by the triage team
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIs
    and removed
    in triagePresently being triaged by the triage team
    on Feb 25, 2026
  2. mbcorona commented on Feb 25, 2026

    @mbcorona
    Member

    Hi @nhh1500,
    I can confirm this behavior, labeling team-framewor for further investigation into the text selection layout logic.

  3. added
    P2Important issues not at the top of the work list
    on Feb 26, 2026
  4. moved this from Incoming Issues to In progress in SelectableRegion Improvementson Mar 13, 2026
  5. github-actions commented on Jul 14, 2026

    @github-actions

    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 -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions