Skip to content

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

Closed

Description

@vitamin33

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

https://github.com/user-attachments/assets/placeholder

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.

Duplicate of #185733 (closed in favor of this simplified issue).

Activity

  1. github-actions commented on May 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.

  2. locked as resolved and limited conversation to collaborators on May 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions