Repository navigation
Description
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:
- Run the code above on desktop or web
- Hover over the text area — cursor shows I-beam (correct)
- 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
saurabh-mirajkar commentedon Apr 30, 2026
@ds-vitse Thanks for the detailed report and proposal. Labeling this as a feature request for further consideration.
Renzo-Olivares commentedon May 8, 2026
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?
victogomez-cs commentedon Nov 12, 2026
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.mouseCursorthat resolves to null still defers to the ancestor cursor.