Selecting text in the `TextBox` triggers an error.
Linlccc opened this issue · 2 comments
Linlccc commented
Describe the bug
System.InvalidOperationException: Covered length must be greater than zero.
at Avalonia.Media.TextFormatting.TextLineImpl.GetTextBounds(Int32 firstTextSourceIndex, Int32 textLength)
at Avalonia.Media.TextFormatting.TextLayout.HitTestTextRange(Int32 start, Int32 length)
at Avalonia.Controls.Presenters.TextPresenter.Render(DrawingContext context)
at Avalonia.Rendering.Composition.CompositingRenderer.UpdateCore()
at Avalonia.Rendering.Composition.CompositingRenderer.Update()
at Avalonia.Rendering.Composition.Compositor.CommitCore()
at Avalonia.Rendering.Composition.Compositor.Commit()
at Avalonia.Media.MediaContext.CommitCompositor(Compositor compositor)
at Avalonia.Media.MediaContext.CommitCompositorsWithThrottling()
at Avalonia.Media.MediaContext.RenderCore()
at Avalonia.Media.MediaContext.Render()
at Avalonia.Threading.DispatcherOperation.InvokeCore()
at Avalonia.Threading.DispatcherOperation.Execute()
at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation job)
at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean fromExplicitBackgroundProcessingCallback)
at Avalonia.Threading.Dispatcher.Signaled()
at Avalonia.Native.DispatcherImpl.Events.Signaled()
at Avalonia.Native.Interop.Impl.__MicroComIAvnPlatformThreadingInterfaceEventsVTable.Signaled(Void* this)
--- End of stack trace from previous location ---
at Avalonia.Native.DispatcherImpl.RunLoop(CancellationToken token)
at Avalonia.Native.DispatcherImpl.RunLoop(CancellationToken token)
at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl)
at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.StartCore(String[] args)
at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder)
at AutoLaunchTestTool.Program.Main(String[] args) in /Users/lin/Files/Git/GitHub/AutoLaunchTestTool/src/Program.cs:line 13
To Reproduce
Select text in a TextBox containing multiple lines and repeat it several times.
2025-09-08.15.10.11.mov
Expected behavior
No response
Avalonia version
11.3.5
OS
macOS
Additional context
No response
miloush commented
I can repro this @Gillibald. In multiline text, go on a beginning of a line, hold shift and click the end of the preceding line.
miloush commented
