You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On most apps, removing all unconverted hiraganas by pressing Backspace cancels conversion entirely and clears all unconverted hiraganas correctly.
In Avalonia on Windows, removal of all unconverted hiraganas is somehow getting treated as input completion of the first hiragana, effectively needing additional Backspace input to remove that erroneously 'completed' hiragana.
Here's the video explaining the issue using the same reproduction app with #18013 . First, I completed typing テスト and cleared it. However, when I tried to delete all the characters after typing てすと, for some reason it remained as if the て was completed, and I had to press backspace again.
AvaloniaInputMethod.2025-01-22.18-47-01.mp4
To Reproduce
Create an Avalonia project with Community Toolkit and Compiled Bindings
Upgrade TargetFramework to net9.0-* in all projects
Edit the MainView.axaml as shown below
Edit the MainViewModel.cs as shown below
Start debugging with physical Windows device with Google Japanese Input installed (Microsoft IME also reproduces this problem)
Type irohanihoheto then hit Backspace 7 times to remove the いろはにほへと shown there, and see what happens
MainView.axaml
<UserControlxmlns="https://github.com/avaloniaui"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:vm="clr-namespace:AvaloniaInputMethod.ViewModels"mc:Ignorable="d"d:DesignWidth="800"d:DesignHeight="450"x:Class="AvaloniaInputMethod.Views.MainView"x:DataType="vm:MainViewModel">
<Design.DataContext>
<!-- This only sets the DataContext for the previewer in an IDE, to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
<vm:MainViewModel />
</Design.DataContext>
<DockPanel>
<Border DockPanel.Dock="Top"Margin="2"BorderBrush="{DynamicResource TextControlBorderBrush}"BorderThickness="1"CornerRadius="2">
<TextBlockText="{Binding Input, Mode=OneWay}"/>
</Border>
<TextBoxText="{Binding Input, Mode=TwoWay}"AcceptsReturn="True"Margin="2"/>
</DockPanel>
</UserControl>
I investigated a little bit about IME's cancel behavior.
It turns out that AppWndProc is receiving WM_IME_COMPOSITION with lParam set to 0 after I do the following:
Removing the entire composition string by pressing Backspace
Pressing Escape while the composition string remains
In VS Code, in both cases, it deleted the entire composition string without entering anything.
But Avalonia's TextBox kept the whole composition string. And when it receives WM_IME_ENDCOMPOSITION, Imm32InputMethod.HandleCompositionEnd checks if Imm32InputMethod.Composition is either null or empty, while it still contains the composition string. As a result, it ends up executing _parent.Input(e); while retaining the mistreated composition string.
Describe the bug
On most apps, removing all unconverted hiraganas by pressing Backspace cancels conversion entirely and clears all unconverted hiraganas correctly.
In Avalonia on Windows, removal of all unconverted hiraganas is somehow getting treated as input completion of the first hiragana, effectively needing additional Backspace input to remove that erroneously 'completed' hiragana.
Here's the video explaining the issue using the same reproduction app with #18013 . First, I completed typing
テスト
and cleared it. However, when I tried to delete all the characters after typingてすと
, for some reason it remained as if theて
was completed, and I had to press backspace again.AvaloniaInputMethod.2025-01-22.18-47-01.mp4
To Reproduce
TargetFramework
tonet9.0-*
in all projectsMainView.axaml
as shown belowMainViewModel.cs
as shown belowirohanihoheto
then hit Backspace 7 times to remove theいろはにほへと
shown there, and see what happensMainView.axaml
MainViewModel.cs
Expected behavior
い
doesn't show after removing unconvertedいろはにほへと
Avalonia version
11.2.3
OS
Windows
Additional context
The text was updated successfully, but these errors were encountered: