dotnet / dotnet/wpf

TextBox SelectAll Input Chinese crash

Open
#7,304 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: .NET6
* Windows version: (`Windows10`)
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
*
Problem description:TextBox SelectAll Input Chinese crash

``` xaml



```

```C#
public MainWindow()
{
InitializeComponent();
//In actual business, sometimes I need to assign a string with a newline character
textEdit.Text = "testasdfasdfgasd阿斯顿发斯蒂芬\r\n撒旦法师打发斯蒂芬\r\n阿斯顿发送到发送到\r\n";
}
```

When there are multiple lines of strings, when using the Chinese input method to input, the selected text will crash directly
I know setting AcceptsReturn="True" UndoLimit!="0" will fix this
But I need to use Enter event, so it doesn't work for me
So how should I solve this problem?

![WPFTextBoxBug](https://user-images.githubusercontent.com/54973061/202776437-ce6ca4c1-85f5-498b-b1aa-5add250e1fea.gif)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.