Skip to content

Allow setting a custom mouse cursor for the scrollbar inside TextField #185813

Description

@ds-vitaliise

Use case

TextField has a mouseCursor parameter, but it applies to the entire widget including the scrollbar area. When a multiline TextField displays a scrollbar, the mouse cursor stays as an I-beam when hovering over the scrollbar thumb and track. Users expect the cursor to change to a default arrow pointer, matching native platform behavior.

There is currently no way to set a different cursor for the scrollbar only — TextField.mouseCursor changes both the text area and scrollbar cursors together.

Screen recording

scrollbar_cursor_bug.mp4

Minimal reproduction

import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) {
    final text = List.generate(30, (i) => 'Line $i: Text content.').join('\n');
    return MaterialApp(
      home: Scaffold(
        body: Padding(
          padding: const EdgeInsets.all(32),
          child: SizedBox(
            width: 400,
            height: 300,
            child: TextField(
              maxLines: null,
              expands: true,
              controller: TextEditingController(text: text),
              decoration: const InputDecoration(border: OutlineInputBorder()),
            ),
          ),
        ),
      ),
    );
  }
}

Steps:

  1. Run the code above on desktop or web
  2. Hover over the text area — cursor shows I-beam (correct)
  3. Move cursor to the scrollbar — cursor stays I-beam (expected: arrow)

Flutter version: 3.35.7 (Dart 3.9.2)

Proposal

Two possible approaches:

a) Add a scrollbarMouseCursor parameter to TextField, allowing consumers to set the cursor specifically for the scrollbar area independently from the text area cursor.

b) Add a mouseCursor parameter to RawScrollbar, so any scrollbar (not just inside TextField) can have a custom cursor when hovered.

Activity

  1. saurabh-mirajkar commented on Apr 30, 2026

    @saurabh-mirajkar
    Contributor

    @ds-vitse Thanks for the detailed report and proposal. Labeling this as a feature request for further consideration.

  2. added
    a: text inputEntering text in a text field or keyboard related problems
    c: new featureNothing broken; request for a new capability
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Apr 30, 2026
  3. added
    P2Important issues not at the top of the work list
    P3Issues that are less important to the Flutter project
    and removed
    P2Important issues not at the top of the work list
    on Apr 30, 2026
  4. added
    P2Important issues not at the top of the work list
    and removed
    P3Issues that are less important to the Flutter project
    on May 8, 2026
  5. Renzo-Olivares commented on May 8, 2026

    @Renzo-Olivares
    Contributor

    Hi @ds-vitse, thank you for reporting this.

    The custom portion of this issue is a proposal but I think the default behavior is a real bug. By default the mouse cursor should not be an ibeam for a scrollbar in a TextField.

    I think fixing the default behavior is preferred in this case. Do you have a separate use-case for having a custom mouse cursor other than fixing the default behavior?

  6. victogomez-cs commented on Nov 12, 2026

    @victogomez-cs

    A fix for the default cursor is up in #196469. Hovering the scrollbar now shows the arrow, and the text area still shows the I-beam. A RawScrollbar.mouseCursor that resolves to null still defers to the ancestor cursor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions