-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.0Found to occur in 2.0Found to occur in 2.0frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work on
Description
Hi !
I'm currently building a RichTextField/RichTextEditor for Flutter, but I started having some bugs on MacOS that I don't have on other platforms (iOS, Web, Android). I wondered what it was and found out that the backspace key triggers the "onChanged" method multiple times on MacOS (might be the same on Windows or Linux, I don't have access to any of these OS to try, so I don't know).
Steps to Reproduce
- Run
flutter create bug. - In main.dart : inside the build method of _MyHomePageState, remove everything inside "body" and replace it with this :
TextField(
onChanged: (text) => print('textChanged'),
),
- Run on macOS.
- Write some text (even a single letter would work).
- (Optional) Clear the log console.
- Press backspace once.
Expected results: "textChanged" logged 1x in the console.
Actual results: "textChanged" logged 3x in the console.
Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.0Found to occur in 2.0Found to occur in 2.0frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work on