From c1410af0d5edca7db2ca136c6e94131a563bd212 Mon Sep 17 00:00:00 2001 From: mrmandrake Date: Wed, 18 Jan 2023 00:47:50 +0100 Subject: [PATCH 1/3] Update TextInputResponder.cs fixes #9956 --- src/iOS/Avalonia.iOS/TextInputResponder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iOS/Avalonia.iOS/TextInputResponder.cs b/src/iOS/Avalonia.iOS/TextInputResponder.cs index d5723d78f7..8862f4e392 100644 --- a/src/iOS/Avalonia.iOS/TextInputResponder.cs +++ b/src/iOS/Avalonia.iOS/TextInputResponder.cs @@ -445,7 +445,7 @@ partial class AvaloniaView UITextPosition IUITextInput.BeginningOfDocument => _beginningOfDocument; - private int DocumentLength => _client.SurroundingText.Text.Length + (_markedText?.Length ?? 0); + private int DocumentLength => (_client.SurroundingText.Text?.Length ?? 0) + (_markedText?.Length ?? 0); UITextPosition IUITextInput.EndOfDocument => new AvaloniaTextPosition(DocumentLength); UITextRange IUITextInput.MarkedTextRange From f675750aba8d17ae4f93fa96386995d92b702e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wies=C5=82aw=20=C5=A0olt=C3=A9s?= Date: Wed, 18 Jan 2023 11:30:21 +0100 Subject: [PATCH 2/3] Fix BackRequested EventHandler args type --- src/Avalonia.Controls/TopLevel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/TopLevel.cs b/src/Avalonia.Controls/TopLevel.cs index c0265e28b9..ff241dce7a 100644 --- a/src/Avalonia.Controls/TopLevel.cs +++ b/src/Avalonia.Controls/TopLevel.cs @@ -318,7 +318,7 @@ namespace Avalonia.Controls /// /// Occurs when physical Back Button is pressed or a back navigation has been requested. /// - public event EventHandler BackRequested + public event EventHandler BackRequested { add { AddHandler(BackRequestedEvent, value); } remove { RemoveHandler(BackRequestedEvent, value); } From 85e7f383a21a8519920316b73ee3a90148441e22 Mon Sep 17 00:00:00 2001 From: Emmanuel Hansen Date: Wed, 18 Jan 2023 11:13:44 +0000 Subject: [PATCH 3/3] fix crash in previewer for refresh container --- src/Avalonia.Controls/PullToRefresh/RefreshVisualizer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/PullToRefresh/RefreshVisualizer.cs b/src/Avalonia.Controls/PullToRefresh/RefreshVisualizer.cs index 8723304f8f..d2a35bb6aa 100644 --- a/src/Avalonia.Controls/PullToRefresh/RefreshVisualizer.cs +++ b/src/Avalonia.Controls/PullToRefresh/RefreshVisualizer.cs @@ -151,7 +151,11 @@ namespace Avalonia.Controls _content.Loaded += (s, e) => { var composition = ElementComposition.GetElementVisual(_content); - var compositor = composition!.Compositor; + + if(composition == null) + return; + + var compositor = composition.Compositor; composition.Opacity = 0; var smoothRotationAnimation