diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png new file mode 100644 index 000000000000..a77770c918d0 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png differ diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue30052.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue30052.cs new file mode 100644 index 000000000000..26ef58e4749d --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue30052.cs @@ -0,0 +1,33 @@ +namespace Maui.Controls.Sample.Issues; + +[Issue(IssueTracker.Github, 30052, "Right-To-Left (RTL) alignment is not applied to Editor placeholder", PlatformAffected.iOS)] +public class Issue30052 : TestContentPage +{ + protected override void Init() + { + Content = new VerticalStackLayout + { + FlowDirection = FlowDirection.RightToLeft, + Children = + { + new Editor + { + Placeholder = "This is a placeholder in an editor", + AutomationId = "Editor" + }, + new Editor + { + Text = "Right to left - editor" + }, + new Entry + { + Placeholder = "This is a placeholder in an entry" + }, + new Entry + { + Text = "Right to left - entry" + } + } + }; + } +} diff --git a/src/Controls/tests/TestCases.Mac.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png b/src/Controls/tests/TestCases.Mac.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png new file mode 100644 index 000000000000..39ea0f0307a1 Binary files /dev/null and b/src/Controls/tests/TestCases.Mac.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png differ diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30052.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30052.cs new file mode 100644 index 000000000000..27363f6b6cbb --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30052.cs @@ -0,0 +1,20 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues; + +public class Issue30052 : _IssuesUITest +{ + public Issue30052(TestDevice testDevice) : base(testDevice) { } + + public override string Issue => "Right-To-Left (RTL) alignment is not applied to Editor placeholder"; + + [Test] + [Category(UITestCategories.Editor)] + public void RTLShouldBeAppliedToPlaceholers() + { + App.WaitForElement("Editor"); + VerifyScreenshot(); + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png new file mode 100644 index 000000000000..8595bc575e8e Binary files /dev/null and b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png new file mode 100644 index 000000000000..d50deafe8759 Binary files /dev/null and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/RTLShouldBeAppliedToPlaceholers.png differ diff --git a/src/Core/src/Platform/iOS/MauiTextView.cs b/src/Core/src/Platform/iOS/MauiTextView.cs index abd5be6475b1..4cab49c994be 100644 --- a/src/Core/src/Platform/iOS/MauiTextView.cs +++ b/src/Core/src/Platform/iOS/MauiTextView.cs @@ -146,7 +146,9 @@ void UpdatePlaceholderLabelFrame() var height = Frame.Height - (TextContainerInset.Top + TextContainerInset.Bottom); _placeholderLabel.Frame = new CGRect(x, y, width, height); - } + _placeholderLabel.SemanticContentAttribute = SemanticContentAttribute; + _placeholderLabel.TextAlignment = TextAlignment; + }; } void HidePlaceholderIfTextIsPresent(string? value)