diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/PageShouldNotScroll.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/PageShouldNotScroll.png index 20a088003f6a..99824db0acb0 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/PageShouldNotScroll.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/PageShouldNotScroll.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/PickerNewKeyboardIsAboveKeyboard_Entry7.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/PickerNewKeyboardIsAboveKeyboard_Entry7.png index f6a2ba16e58c..70eb442b2ad0 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/PickerNewKeyboardIsAboveKeyboard_Entry7.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/PickerNewKeyboardIsAboveKeyboard_Entry7.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShadowAddClip.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShadowAddClip.png index 7e857aaa8d2a..451240246401 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShadowAddClip.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShadowAddClip.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShadowRemoveClip.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShadowRemoveClip.png index 2be73b534c7b..30ebdd709e87 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShadowRemoveClip.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShadowRemoveClip.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_AddClip_VerifyShadow.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_AddClip_VerifyShadow.png index 87f93da31763..f7bef7a7961f 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_AddClip_VerifyShadow.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_AddClip_VerifyShadow.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_ChangeFlowDirection_RTL_VerifyScreenshot.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_ChangeFlowDirection_RTL_VerifyScreenshot.png index 38c02ae9484c..8c80b5e17945 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_ChangeFlowDirection_RTL_VerifyScreenshot.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_ChangeFlowDirection_RTL_VerifyScreenshot.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetEnabledStateToFalse_VerifyScreenshot.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetEnabledStateToFalse_VerifyScreenshot.png index c8b6befc8d58..82de865a3fc5 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetEnabledStateToFalse_VerifyScreenshot.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetEnabledStateToFalse_VerifyScreenshot.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOffset_PositiveValues.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOffset_PositiveValues.png index 3bc683915cce..83e52d091378 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOffset_PositiveValues.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOffset_PositiveValues.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOffset_Zero.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOffset_Zero.png index 63761fe7dde7..be2a30fa197e 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOffset_Zero.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOffset_Zero.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOpacity.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOpacity.png index 58226acfd196..452e1944ffa0 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOpacity.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOpacity.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOpacity_Zero.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOpacity_Zero.png index e2a0fad09a61..190b6d76692a 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOpacity_Zero.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetOpacity_Zero.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetRadius.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetRadius.png index 97e30bc07e18..194707b609be 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetRadius.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetRadius.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetRadius_Zero.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetRadius_Zero.png index 537df2f30600..65684c1bdaf6 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetRadius_Zero.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetRadius_Zero.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetVisibilityToFalse_VerifyScreenshot.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetVisibilityToFalse_VerifyScreenshot.png index 9931f585c792..b18a64ccd696 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetVisibilityToFalse_VerifyScreenshot.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Shadow_SetVisibilityToFalse_VerifyScreenshot.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ValidateEntryClearButtonVisibilityBehavior.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ValidateEntryClearButtonVisibilityBehavior.png index 3ed29868cddc..95ab55257a45 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ValidateEntryClearButtonVisibilityBehavior.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ValidateEntryClearButtonVisibilityBehavior.png differ diff --git a/src/Core/src/Handlers/Editor/EditorHandler.iOS.cs b/src/Core/src/Handlers/Editor/EditorHandler.iOS.cs index 843d962dc3ea..aaf1a2ec7eda 100644 --- a/src/Core/src/Handlers/Editor/EditorHandler.iOS.cs +++ b/src/Core/src/Handlers/Editor/EditorHandler.iOS.cs @@ -14,28 +14,10 @@ public partial class EditorHandler : ViewHandler protected override MauiTextView CreatePlatformView() { var platformEditor = new MauiTextView(); - -#if !MACCATALYST - var accessoryView = new MauiDoneAccessoryView(); - accessoryView.SetDataContext(this); - accessoryView.SetDoneClicked(OnDoneClicked); - platformEditor.InputAccessoryView = accessoryView; -#endif - + platformEditor.AddMauiDoneAccessoryView(this); return platformEditor; } -#if !MACCATALYST - static void OnDoneClicked(object sender) - { - if (sender is IEditorHandler handler) - { - handler.PlatformView.ResignFirstResponder(); - handler.VirtualView.Completed(); - } - } -#endif - public override void SetVirtualView(IView view) { base.SetVirtualView(view); diff --git a/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs b/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs index 20c31183773a..43599f343d46 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs @@ -11,13 +11,18 @@ public partial class EntryHandler : ViewHandler { readonly MauiTextFieldProxy _proxy = new(); - protected override MauiTextField CreatePlatformView() => - new MauiTextField + protected override MauiTextField CreatePlatformView() + { + var platformEntry = new MauiTextField { BorderStyle = UITextBorderStyle.RoundedRect, ClipsToBounds = true }; + platformEntry.AddMauiDoneAccessoryView(this); + return platformEntry; + } + public override void SetVirtualView(IView view) { base.SetVirtualView(view); diff --git a/src/Core/src/Platform/iOS/TextFieldExtensions.cs b/src/Core/src/Platform/iOS/TextFieldExtensions.cs index 3b5211076a0c..886b48fc5f4a 100644 --- a/src/Core/src/Platform/iOS/TextFieldExtensions.cs +++ b/src/Core/src/Platform/iOS/TextFieldExtensions.cs @@ -246,5 +246,24 @@ internal static void UpdateClearButtonColor(this UITextField textField, IEntry e context?.FillRect(rect, CGBlendMode.SourceIn); }); } + + internal static void AddMauiDoneAccessoryView(this UITextField textField, IViewHandler handler) + { +#if !MACCATALYST + var accessoryView = new MauiDoneAccessoryView(); + accessoryView.SetDataContext(handler); + accessoryView.SetDoneClicked(OnDoneClicked); + textField.InputAccessoryView = accessoryView; +#endif + } + + static void OnDoneClicked(object sender) + { + if (sender is IEntryHandler entryHandler) + { + entryHandler.PlatformView.ResignFirstResponder(); + entryHandler.VirtualView.Completed(); + } + } } } diff --git a/src/Core/src/Platform/iOS/TextViewExtensions.cs b/src/Core/src/Platform/iOS/TextViewExtensions.cs index 10518c47314a..55b8af9713f3 100644 --- a/src/Core/src/Platform/iOS/TextViewExtensions.cs +++ b/src/Core/src/Platform/iOS/TextViewExtensions.cs @@ -177,5 +177,24 @@ static UITextPosition GetSelectionEnd(UITextView textView, IEditor editor, UITex return end; } + + internal static void AddMauiDoneAccessoryView(this UITextView textView, IViewHandler handler) + { +#if !MACCATALYST + var accessoryView = new MauiDoneAccessoryView(); + accessoryView.SetDataContext(handler); + accessoryView.SetDoneClicked(OnDoneClicked); + textView.InputAccessoryView = accessoryView; +#endif + } + + static void OnDoneClicked(object sender) + { + if (sender is IEditorHandler entryHandler) + { + entryHandler.PlatformView.ResignFirstResponder(); + entryHandler.VirtualView.Completed(); + } + } } }