AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.98k stars 2.25k forks source link

Text processing bugs #7502

Closed Gillibald closed 2 years ago

Gillibald commented 2 years ago

This issue helps track bugs related to recent text processing changes. Feel free to post your findings here.

Gillibald commented 2 years ago

There are a few more, if editing text is an ongoing work, it can be addressed after merge.

(from ControlCatalog):

Originally posted by @danielmayost in https://github.com/AvaloniaUI/Avalonia/issues/4893#issuecomment-1026208611

danielmayost commented 2 years ago
Gillibald commented 2 years ago
  1. Selection rectangles are currently not merged will change that.
  2. Currently keyboard navigation is always in logical order are you suggesting to reverse that when the FlowDirection is RightToLeft?
danielmayost commented 2 years ago

yes, should be like windows notepad etc. in most programs, this is how it works.

maxkatz6 commented 2 years ago

https://user-images.githubusercontent.com/3163374/152086985-32b8c842-25e7-4eff-970b-6321427f44e0.mp4

Sorien commented 2 years ago

https://user-images.githubusercontent.com/1270275/152163399-cc8c4abe-fe79-446c-b7a1-cc3a3868ec74.mp4

it looks like two bugs at the 5. and 11. sec. it should not change the selection

hez2010 commented 2 years ago

https://user-images.githubusercontent.com/14960345/152672625-31e4b41b-0c7c-4f35-9130-c8de39383582.mp4

Note: I tested them against the branch in https://github.com/AvaloniaUI/Avalonia/pull/7509

danielmayost commented 2 years ago
adirh3 commented 2 years ago
luthfiampas commented 2 years ago

record-(2)

https://github.com/AvaloniaUI/Avalonia/pull/7280/files#diff-1b561a0dd4b8160e998d7346ff6b4d5c75ceb71edc990b1b302468cbabfe7a65R1012

danipen commented 2 years ago
adirh3 commented 2 years ago

Before - image

After - image

Gillibald commented 2 years ago

When setting RTL flow direction causing controls to stretch indefinitely. Before - image

After - image

Must be something special about Menu/Flyout will try to reproduce it

adirh3 commented 2 years ago

When setting RTL flow direction causing controls to stretch indefinitely. Before - image After - image

Must be something special about Menu/Flyout will try to reproduce it

It seems to happen to almost everything. I might be using it wrong? Tried setting FlowDirection to all TextBlocks using a Style

Before: image

After:

image
Gillibald commented 2 years ago

Setting TextAlignment.Right and FlowDirection.LeftToRight most likely has the same issue

adirh3 commented 2 years ago

@Gillibald sharing here a few exceptions from users, I haven't personally reproduced all of them, but they do not happen on previous version of my app (only change is Avalonia from 0.10.12 -> master).

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'length')

Avalonia.Media.TextFormatting
FormattedTextSource.CreateTextStyleRun (ReadOnlySlice`1 text, TextRunProperties defaultProperties, IReadOnlyList`1 textModifier)
Avalonia.Media.TextFormatting
FormattedTextSource.GetTextRun (Int32 textSourceIndex)
Avalonia.Media.TextFormatting
TextFormatterImpl.FetchTextRuns (ITextSource textSource, Int32 firstTextSourceIndex, TextEndOfLine& endOfLine, TextRange& textRange)
Avalonia.Media.TextFormatting
TextFormatterImpl.FormatLine (ITextSource textSource, Int32 firstTextSourceIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak)
Avalonia.Media.TextFormatting
TextLayout.CreateTextLines ()
Avalonia.Controls.Presenters
TextPresenter.CreateTextLayoutInternal (Size constraint, String text, Typeface typeface, IReadOnlyList`1 textStyleOverrides)
Avalonia.Controls.Presenters
TextPresenter.CreateTextLayout ()
Avalonia.Controls.Presenters
TextPresenter.get_TextLayout ()
Avalonia.Controls.Presenters
TextPresenter.MoveCaretToTextPosition (Int32 textPosition, Boolean trailingEdge)
Avalonia
DirectProperty`2.InvokeSetter (IAvaloniaObject instance, BindingValue`1 value)
Avalonia
AvaloniaObject.SetDirectValueUnchecked[T] (DirectPropertyBase`1 property, BindingValue`1 value)
Avalonia.AvaloniaObject
DirectBindingSubscription`1.OnNext (BindingValue`1 value)
Avalonia.Reactive
TypedBindingAdapter`1.OnNext (BindingValue`1 value)
Avalonia.Reactive
BindingValueAdapter`1.OnNext (T value)
Avalonia
AvaloniaObject.RaisePropertyChanged[T] (AvaloniaPropertyChangedEventArgs`1 change)
Avalonia.Controls
TextBox.set_CaretIndex (Int32 value)
Avalonia.Controls
TextBox.DeleteSelection (Boolean raiseTextChanged)
Avalonia.Controls
TextBox.OnKeyDown (KeyEventArgs e)
System.Reactive.Subjects
Subject`1.OnNext (T value) /_/Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs:145
Avalonia.Interactivity
EventRoute.RaiseEventImpl (RoutedEventArgs e)
Avalonia.Interactivity
EventRoute.RaiseEvent (IInteractive source, RoutedEventArgs e)
Avalonia.Interactivity
Interactive.RaiseEvent (RoutedEventArgs e)
Avalonia.Input
KeyboardDevice.ProcessRawEvent (RawInputEventArgs e)
Avalonia.Input
InputManager.ProcessInput (RawInputEventArgs e)
Avalonia.Win32
WindowImpl.AppWndProc (IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
Avalonia.Win32
WindowImpl.WndProc (IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
Avalonia.Win32.Interop
UnmanagedMethods.DispatchMessage (MSG& lpmsg)
Avalonia.Win32
Win32Platform.RunLoop (CancellationToken cancellationToken)
Avalonia.Threading
Dispatcher.MainLoop (CancellationToken cancellationToken)
Avalonia.Controls.ApplicationLifetimes
ClassicDesktopStyleApplicationLifetime.Start (String[] args)
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'length')

Avalonia.Utilities
ReadOnlySlice`1.Take (Int32 length)
Avalonia.Media.TextFormatting
FormattedTextSource.CreateTextStyleRun (ReadOnlySlice`1 text, TextRunProperties defaultProperties, IReadOnlyList`1 textModifier)
Avalonia.Media.TextFormatting
TextFormatterImpl.FetchTextRuns (ITextSource textSource, Int32 firstTextSourceIndex, TextEndOfLine& endOfLine, TextRange& textRange)
Avalonia.Media.TextFormatting
TextLayout.CreateTextLines ()
Avalonia.Media.TextFormatting.TextLayout
Avalonia.Media.TextFormatting.TextLayout..ctor(String text, Typeface typeface, Double fontSize, IBrush foreground, TextAlignment textAlignment, TextWrapping textWrapping, TextTrimming textTrimming, TextDecorationCollection textDecorations, FlowDirection flowDirection, Double maxWidth, Double maxHeight, Double lineHeight, Int32 maxLines, IReadOnlyList`1 textStyleOverrides)
Avalonia.Controls.Presenters
TextPresenter.CreateTextLayoutInternal (Size constraint, String text, Typeface typeface, IReadOnlyList`1 textStyleOverrides)
Avalonia.Controls.Presenters
TextPresenter.CreateTextLayout ()
Avalonia.Controls.Presenters
TextPresenter.get_TextLayout ()
Avalonia.Controls.Presenters
TextPresenter.MoveCaretToTextPosition (Int32 textPosition, Boolean trailingEdge)
Avalonia.Controls.Presenters
TextPresenter.set_CaretIndex (Int32 value)
Avalonia.Controls.Presenters.TextPresenter.<>c
<.cctor>b__24_1 (TextPresenter o, Int32 v)
Avalonia
DirectProperty`2.InvokeSetter (IAvaloniaObject instance, BindingValue`1 value)
Avalonia
AvaloniaObject.SetDirectValueUnchecked[T] (DirectPropertyBase`1 property, BindingValue`1 value)
Avalonia.AvaloniaObject
DirectBindingSubscription`1.OnNext (BindingValue`1 value)
Avalonia.Reactive
SingleSubscriberObservableBase`1.PublishNext (T value)
Avalonia.Reactive
TypedBindingAdapter`1.OnNext (BindingValue`1 value)
Avalonia.Reactive
BindingValueAdapter`1.OnNext (T value)
Avalonia.Data
TemplateBinding.TemplatedParentPropertyChanged (Object sender, AvaloniaPropertyChangedEventArgs e)
Avalonia
AvaloniaObject.RaisePropertyChanged[T] (AvaloniaPropertyChangedEventArgs`1 change)
Avalonia
AvaloniaObject.SetAndRaise[T] (AvaloniaProperty`1 property, T& field, T value)
Avalonia.Controls
TextBox.set_CaretIndex (Int32 value)
Avalonia.Controls
TextBox.DeleteSelection (Boolean raiseTextChanged)
Avalonia.Controls
TextBox.OnKeyDown (KeyEventArgs e)
Avalonia.Input.InputElement.<>c
<.cctor>b__32_2 (InputElement x, KeyEventArgs e)
System.Reactive
ObserverBase`1.OnNext (T value) /_/Rx.NET/Source/src/System.Reactive/ObserverBase.cs:32
Avalonia.Interactivity
EventRoute.RaiseEventImpl (RoutedEventArgs e)
Avalonia.Interactivity
Interactive.RaiseEvent (RoutedEventArgs e)
Avalonia.Input
KeyboardDevice.ProcessRawEvent (RawInputEventArgs e)
Avalonia.Controls
TopLevel.HandleInput (RawInputEventArgs e)
Avalonia.Win32
WindowImpl.AppWndProc (IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
Avalonia.Win32
WindowImpl.WndProc (IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
Avalonia.Win32.Interop
UnmanagedMethods.DispatchMessage (MSG& lpmsg)
Avalonia.Win32
Win32Platform.RunLoop (CancellationToken cancellationToken)
Avalonia.Threading
Dispatcher.MainLoop (CancellationToken cancellationToken)
Avalonia.Controls.ApplicationLifetimes
ClassicDesktopStyleApplicationLifetime.Start (String[] args)
System.NullReferenceException: Object reference not set to an instance of an object.

Avalonia.Media.TextFormatting
TextFormatterImpl.MeasureLength (IReadOnlyList`1 textRuns, TextRange textRange, Double paragraphWidth)
Avalonia.Media.TextFormatting
TextFormatterImpl.PerformTextWrapping (List`1 textRuns, TextRange textRange, Double paragraphWidth, TextParagraphProperties paragraphProperties, FlowDirection flowDirection, TextLineBreak currentLineBreak)
Avalonia.Media.TextFormatting
TextLayout.CreateTextLines ()
Avalonia.Controls
TextBlock.CreateTextLayout (Size constraint, String text)
Avalonia.Controls
TextBlock.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Layout
LayoutManager.Measure (ILayoutable control)
Avalonia.Layout
LayoutManager.ExecuteLayoutPass ()
Avalonia.Threading
JobRunner.RunJobs (Nullable`1 priority)
Avalonia.Win32
Win32Platform.WndProc (IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
Avalonia.Win32.Interop
UnmanagedMethods.DispatchMessage (MSG& lpmsg)
Avalonia.Win32
Win32Platform.RunLoop (CancellationToken cancellationToken)
Avalonia.Threading
Dispatcher.MainLoop (CancellationToken cancellationToken)
Avalonia.Controls.ApplicationLifetimes
ClassicDesktopStyleApplicationLifetime.Start (String[] args)
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter 'length')

System
String.Substring (Int32 startIndex, Int32 length)
Avalonia.Controls
TextBox.HandleTextInput (String input)
Avalonia.Controls
TextBox.OnTextInput (TextInputEventArgs e)
Avalonia.Input.InputElement.<>c
<.cctor>b__32_4 (InputElement x, TextInputEventArgs e)
System.Reactive.Subjects
Subject`1.OnNext (T value) /_/Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs:145
Avalonia.Interactivity
EventRoute.RaiseEventImpl (RoutedEventArgs e)
Avalonia.Interactivity
EventRoute.RaiseEvent (IInteractive source, RoutedEventArgs e)
Avalonia.Interactivity
Interactive.RaiseEvent (RoutedEventArgs e)
Avalonia.Input
KeyboardDevice.ProcessRawEvent (RawInputEventArgs e)
Avalonia.Input
InputManager.ProcessInput (RawInputEventArgs e)
Avalonia.Win32
WindowImpl.AppWndProc (IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
Avalonia.Win32
WindowImpl.WndProc (IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
Avalonia.Win32.Interop
UnmanagedMethods.DispatchMessage (MSG& lpmsg)
Avalonia.Win32
Win32Platform.RunLoop (CancellationToken cancellationToken)
Avalonia.Threading
Dispatcher.MainLoop (CancellationToken cancellationToken)
Avalonia.Controls.ApplicationLifetimes
ClassicDesktopStyleApplicationLifetime.Start (String[] args)
System.ArgumentNullException: Value cannot be null. (Parameter 'name'

Avalonia.Media.FontFamily
Avalonia.Media.FontFamily..ctor(Uri baseUri, String name)
Avalonia.Media.FontFamily
Avalonia.Media.FontFamily..ctor(String name)
Avalonia.Media.Typeface
Avalonia.Media.Typeface..ctor(String fontFamilyName, FontStyle style, FontWeight weight)
Avalonia.Skia
FontManagerImpl.TryMatchCharacter (Int32 codepoint, FontStyle fontStyle, FontWeight fontWeight, FontFamily fontFamily, CultureInfo culture, Typeface& fontKey)
Avalonia.Media
FontManager.TryMatchCharacter (Int32 codepoint, FontStyle fontStyle, FontWeight fontWeight, FontFamily fontFamily, CultureInfo culture, Typeface& typeface)
Avalonia.Media.TextFormatting
TextCharacters.CreateShapeableRun (ReadOnlySlice`1 text, TextRunProperties defaultProperties, SByte biDiLevel, TextRunProperties& previousProperties)
Avalonia.Media.TextFormatting
TextFormatterImpl.CoalesceLevels (IReadOnlyList`1 textCharacters, ReadOnlySlice`1 levels) +MoveNext()
Avalonia.Media.TextFormatting
TextFormatterImpl.ShapeTextRuns (List`1 textRuns, FlowDirection flowDirection, FlowDirection& resolvedFlowDirection)
Avalonia.Media.TextFormatting
TextLayout.CreateTextLines ()
Avalonia.Controls
TextBlock.CreateTextLayout (Size constraint, String text)
Avalonia.Controls
TextBlock.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Controls
DockPanel.MeasureOverride (Size constraint)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Layout
LayoutHelper.MeasureChild (ILayoutable control, Size availableSize, Thickness padding)
Avalonia.Controls.Presenters
ContentPresenter.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Layout
Layoutable.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Layout
Layoutable.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Layout
LayoutHelper.MeasureChild (ILayoutable control, Size availableSize, Thickness padding)
Avalonia.Controls.Presenters
ContentPresenter.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Layout
Layoutable.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Layout
LayoutHelper.MeasureChild (ILayoutable control, Size availableSize, Thickness padding)
Avalonia.Controls
Border.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Layout
Layoutable.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Layout
LayoutHelper.MeasureChild (ILayoutable control, Size availableSize, Thickness padding)
Avalonia.Controls.Presenters
ContentPresenter.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Controls
StackPanel.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Controls.Presenters
ItemVirtualizer.MeasureOverride (Size availableSize)
Avalonia.Controls.Presenters
ItemsPresenter.MeasureOverride (Size availableSize)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Controls
DockPanel.MeasureOverride (Size constraint)
Avalonia.Layout
Layoutable.MeasureCore (Size availableSize)
Avalonia.Layout
Layoutable.Measure (Size availableSize)
Avalonia.Layout
LayoutManager.Measure (ILayoutable control)
Avalonia.Layout
LayoutManager.Measure (ILayoutable control)
Avalonia.Layout
LayoutManager.Measure (ILayoutable control)
Avalonia.Layout
LayoutManager.Measure (ILayoutable control)
Avalonia.Layout
LayoutManager.Measure (ILayoutable control)
Avalonia.Layout
LayoutManager.ExecuteMeasurePass ()
Avalonia.Layout
LayoutManager.InnerLayoutPass ()
Avalonia.Layout
LayoutManager.ExecuteLayoutPass ()
Avalonia.Threading
JobRunner.RunJobs (Nullable`1 priority)
Avalonia.Win32
Win32Platform.WndProc (IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
Avalonia.Win32.Interop
UnmanagedMethods.DispatchMessage (MSG& lpmsg)
Avalonia.Win32
Win32Platform.RunLoop (CancellationToken cancellationToken)
Avalonia.Threading
Dispatcher.MainLoop (CancellationToken cancellationToken)
Avalonia.Controls.ApplicationLifetimes
ClassicDesktopStyleApplicationLifetime.Start (String[] args)
Gillibald commented 2 years ago

@adirh3 Is there dynamic text displayed by TextBlocks in your app or is it just static? Ideally those users could give me more info about the actual text they were typing or what they were doing at the moment of the crash.

adirh3 commented 2 years ago

@adirh3 Is there dynamic text displayed by TextBlocks in your app or is it just static? Ideally those users could give me more info about the actual text they were typing or what they were doing at the moment of the crash.

I believe most of these are from using TextBox's, and 99% of the displayed text is produced from bindings (TextBlocks). I will try asking them again to post reproes if they find a way.

hez2010 commented 2 years ago

image

image

Other issues not sure whether related:

Gillibald commented 2 years ago

Screenshot 2022-02-24 074244

Build with a just cloned master

Are you using the nuget feed?

You can verify the current build by having a look at FontStretch.Stretch if it exists you got the most recent build if not there is something wrong

hez2010 commented 2 years ago

Are you using the nuget feed?

I pulled code from master branch and build it directly. But I'm on Windows 11, the default system font of English may be different with Windows 10.

Gillibald commented 2 years ago

I just did this:

git clone https://github.com/AvaloniaUI/Avalonia.git
git submodule init
git submodule update
cd Avalonia\samples\ControlCatalog.NetCore
dotnet run

And I get the above result. I am also on Windows 11.

hez2010 commented 2 years ago

I figured out how to repro it: open ControlCatalog, then change your screen dpi. It behaves divergent under different scaling (mine is 250%).

danipen commented 2 years ago

Yes, reproduced here too. It seems that DPI resolution affects to the text vertical alignment:

I found a couple more:

Gillibald commented 2 years ago

Ahh okay so I guess unless I scale up the text it doesn't make sense to scale the bounding box

Gillibald commented 2 years ago

7693 should fix scaling issues

adirh3 commented 2 years ago

after #7693 -

Some selection bug, repro -

  1. Type something
  2. Press Ctrl+Shift+Left
  3. See selection not full image
  4. Press backspace, get this exception - System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'length') at Avalonia.Utilities.ReadOnlySlice1.Take(Int32 length) at Avalonia.Media.TextFormatting.FormattedTextSource.CreateTextStyleRun(ReadOnlySlice1 text, TextRunProperties defaultProperties, IReadOnlyList1 textModifier) at Avalonia.Media.TextFormatting.FormattedTextSource.GetTextRun(Int32 textSourceIndex) at Avalonia.Media.TextFormatting.TextFormatterImpl.TextRunEnumerator.MoveNext() at Avalonia.Media.TextFormatting.TextFormatterImpl.FetchTextRuns(ITextSource textSource, Int32 firstTextSourceIndex, TextEndOfLine& endOfLine, TextRange& textRange) at Avalonia.Media.TextFormatting.TextFormatterImpl.FormatLine(ITextSource textSource, Int32 firstTextSourceIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak) at Avalonia.Media.TextFormatting.TextLayout.CreateTextLines() at Avalonia.Media.TextFormatting.TextLayout..ctor(String text, Typeface typeface, Double fontSize, IBrush foreground, TextAlignment textAlignment, TextWrapping textWrapping, TextTrimming textTrimming, TextDecorationCollection textDecorations, FlowDirection flowDirection, Double maxWidth, Double maxHeight, Double lineHeight, Int32 maxLines, IReadOnlyList1 textStyleOverrides) at Avalonia.Controls.Presenters.TextPresenter.CreateTextLayoutInternal(Size constraint, String text, Typeface typeface, IReadOnlyList1 textStyleOverrides) at Avalonia.Controls.Presenters.TextPresenter.CreateTextLayout() at Avalonia.Controls.Presenters.TextPresenter.get_TextLayout() at Avalonia.Controls.Presenters.TextPresenter.MoveCaretToTextPosition(Int32 textPosition, Boolean trailingEdge) at Avalonia.Controls.Presenters.TextPresenter.set_CaretIndex(Int32 value) at Avalonia.Controls.Presenters.TextPresenter.<>c.<.cctor>b__23_1(TextPresenter o, Int32 v) at Avalonia.DirectProperty2.InvokeSetter(IAvaloniaObject instance, BindingValue1 value) at Avalonia.AvaloniaObject.SetDirectValueUnchecked[T](DirectPropertyBase1 property, BindingValue1 value) at Avalonia.AvaloniaObject.DirectBindingSubscription1.OnNext(BindingValue1 value) at Avalonia.Reactive.SingleSubscriberObservableBase1.PublishNext(T value) at Avalonia.Reactive.TypedBindingAdapter1.OnNext(BindingValue1 value) at Avalonia.Reactive.SingleSubscriberObservableBase1.PublishNext(T value) at Avalonia.Reactive.BindingValueAdapter1.OnNext(T value) at Avalonia.Reactive.SingleSubscriberObservableBase1.PublishNext(T value) at Avalonia.Data.TemplateBinding.PublishValue() at Avalonia.Data.TemplateBinding.TemplatedParentPropertyChanged(Object sender, AvaloniaPropertyChangedEventArgs e) at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaPropertyChangedEventArgs1 change) at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty1 property, Optional1 oldValue, BindingValue1 newValue, BindingPriority priority) at Avalonia.AvaloniaObject.SetAndRaise[T](AvaloniaProperty1 property, T& field, T value) at Avalonia.Controls.TextBox.set_CaretIndex(Int32 value) at Avalonia.Controls.TextBox.DeleteSelection(Boolean raiseTextChanged) at Avalonia.Controls.TextBox.OnKeyDown(KeyEventArgs e) at Blast.Controls.CustomTextBox.OnKeyDown(KeyEventArgs e) in C:\Git\Blast\Blast\Controls\CustomTextBox.cs:line 14 at Avalonia.Input.InputElement.<>c.<.cctor>b32_2(InputElement x, KeyEventArgs e) at Avalonia.Interactivity.RoutedEvent1.<>c__DisplayClass2_01.gAdapter|0(Object sender, RoutedEventArgs e) at Avalonia.Interactivity.RoutedEvent.<>c__DisplayClass23_0.b_0(ValueTuple2 args) at System.Reactive.AnonymousObserver1.OnNextCore(T value) in //Rx.NET/Source/src/System.Reactive/AnonymousObserver.cs:line 67 at System.Reactive.ObserverBase1.OnNext(T value) in /_/Rx.NET/Source/src/System.Reactive/ObserverBase.cs:line 34 at System.Reactive.Subjects.Subject1.OnNext(T value) in /_/Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs:line 147 at Avalonia.Interactivity.RoutedEvent.InvokeRaised(Object sender, RoutedEventArgs e) at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e) at Avalonia.Interactivity.EventRoute.RaiseEvent(IInteractive source, RoutedEventArgs e) at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e) at Avalonia.Input.KeyboardDevice.ProcessRawEvent(RawInputEventArgs e) at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e) at Avalonia.Controls.TopLevel.HandleInput(RawInputEventArgs e) at Avalonia.Win32.WindowImpl.AppWndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) at Avalonia.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg) at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) at Blast.Program.Main(String[] args) in C:\Git\Blast\Blast\Program.cs:line 263
danipen commented 2 years ago

@Gillibald I'm testing the recently merged #7693, and I can still see a couple of issues:

Gillibald commented 2 years ago

Thanks for you feedback will have a look

Gillibald commented 2 years ago

https://github.com/AvaloniaUI/Avalonia/pull/7746 should fix your last findings

danipen commented 2 years ago

@Gillibald yes, now issues are fixed, thanks!!

I found a couple of them more, but really small ones:

hez2010 commented 2 years ago

I found another bug:

  1. input an emoji using win+.
  2. close the emoji select panel
  3. shift + left

image

Gillibald commented 2 years ago

It seems to split the surrogate pair

danielmayost commented 2 years ago
Gillibald commented 2 years ago

if FlowDirection="RightToLeft on TextBox then Backwards key isn't responding or responding wrong.

Wil have a look

robloo commented 2 years ago

image

danielmayost commented 2 years ago

Some issues I encountered during my work #7810:

danipen commented 2 years ago

@Gillibald, I found a missing feature.

Example

https://user-images.githubusercontent.com/501613/159515582-c0a4f7e0-6e88-4799-a469-2a93a121fb4d.mov

Avalonia's

https://user-images.githubusercontent.com/501613/159515549-88039fd5-3085-4427-8d2f-f200fa570aad.mov

danipen commented 2 years ago
Gillibald commented 2 years ago

NavigateToEnd I can't reproduce your last issue. Might be fixed already.

robloo commented 2 years ago

@Gillibald A lot of issues are related to the TextBox functionality I notice. Would it be a good idea to just port the WPF TextBox to Avalonia now? I wouldn't think this would be too difficult considering all the lower-level text API's are now implemented. I know that wasn't possible before but now that WPF is open source and all the base pieces are there this makes the most sense to me.

danielmayost commented 2 years ago

@Gillibald I saw that you marked that the problems were fixed, I checked in front of your branch and did not see any change, you have not yet pushed the changes?

Edit: sorry, I had a problem compiling and thought it was compiled, I see it has been fixed.

Gillibald commented 2 years ago

@robloo Porting WPF's TextBox isn't possible at the moment because it requires the TextContainer. For reference: https://github.com/AvaloniaUI/Avalonia/blob/inlinesTheThird/src/Avalonia.Documents/Documents/TextContainer.cs

danielmayost commented 2 years ago
danipen commented 2 years ago

I can't reproduce your last issue. Might be fixed already.

@Gillibald, sorry I still reproduce the issue in LAST changes on master (commit [0483f9](https://github.com/AvaloniaUI/Avalonia/commit/0483f9bced0ea444b4b25e8b69659e54b80157e8)). Should I test different changes?

The scenario is just clicking the second paragraph and hitting End/ key:

https://user-images.githubusercontent.com/501613/160274457-f1ec9f2e-222b-4288-8c89-5ae5da29b869.mp4

danielmayost commented 2 years ago

Edit: not related to flowDirection, it's always broken, in 175% dpi.

Gillibald commented 2 years ago

@danipen You always need to test against: https://github.com/AvaloniaUI/Avalonia/pull/7746

robloo commented 2 years ago

@Gillibald

Gillibald commented 2 years ago

Please test against: https://github.com/AvaloniaUI/Avalonia/pull/7946

0.10.999-cibuild0020141-beta

danielmayost commented 2 years ago

@Gillibald there is some new bugs since #7946 merged.

I tested against #7946 what @robloo said, the problem is still there. it seems to be related also to scale (dpi), when the scale is 100%, some of the problems no longer exist.