Repository navigation
Closed
flutter-team-archive/engine
#29396Closed
Copy link
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: annoyanceRepeatedly frustrating issues with non-experimental functionalityRepeatedly frustrating issues with non-experimental functionalitya: desktopRunning on desktopRunning on desktopa: 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 nowplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specifically
Description
On Windows, the last composing character either can't be deleted or takes an extra backspace.
- Run the app below (anything with a text field) on Windows.
- Type some composing text, such as "nihao" with your input set to Chinese pinyin.
- Use the backspace key to delete the characters you entered.
Expected: 5 backspaces should delete "nihao"
Actual: The fifth backspace removes the composing region and the sixth deletes the final "n". Or, sometimes I am unable to delete the final letter at all, but I'm not sure how to consistently reproduce that.
Here's a video, but unfortunately it doesn't capture the composing menu.
sandbox.2021-10-19.13-54-21.mp4
Code
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
//import 'package:flutter_localizations/flutter_localizations.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: Scaffold(
appBar: AppBar(
title: const Text('Flutter Demo Home Page'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
TextField(),
],
),
),
),
);
}
}Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: annoyanceRepeatedly frustrating issues with non-experimental functionalityRepeatedly frustrating issues with non-experimental functionalitya: desktopRunning on desktopRunning on desktopa: 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 nowplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specifically
Activity
gspencergoog commentedon Oct 21, 2021
cc @cbracken
dkwingsmt commentedon Oct 25, 2021
Is it related to #91861 ? It seems that there's a decorational
'that took one backspace to delete. And sometimes there's a discrepancy between states, so that while the actual precomp only had 5 characters (thus allowing 5 Backspaces), the displayed precomp had 6 characters (including the', thus allowing 6 Backspaces.)justinmc commentedon Oct 26, 2021
Could be, I should try the exact example with "w"s in #91861 on Windows. Though I'd expect the decorational space problem to happen in between "ni" and "hao", but it seems to happen at the "n" here.
gspencergoog commentedon Oct 27, 2021
When I enter just "ni" and then try to delete it, it takes three deletes to remove it, so it doesn't have to do with the extra
'character.gspencergoog commentedon Oct 27, 2021
It seems like it has to do with dismissing the IME: One of the deletes dismisses the IME without removing a character.
gspencergoog commentedon Oct 29, 2021
OK, I think I figured it out. It appears to be because when the last character is deleted from the composing string, we fetch the composing string's
std::optional<std::u16string>, and we do something if theoptionalis set, but we don't update the composing region if it is empty.The bug is here: https://github.com/flutter/engine/blob/fd992c6a0f4cc5c5b6efc4b6b60e661f3dc62916/shell/platform/windows/window_win32.cc#L195-L197
gspencergoog commentedon Oct 29, 2021
PR incoming.
github-actions commentedon Nov 15, 2021
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 -vand a minimal reproduction of the issue.