Skip to content

[iOS/MacOs] Right-To-Left (RTL) alignment is not applied to Editor placeholder - fix #30057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue30052.cs
Original file line number Diff line number Diff line change
@@ -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 =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the test also verify changes at runtime? like change the FlowDirection tapping a Button.

{
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"
}
}
};
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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();
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/Core/src/Platform/iOS/MauiTextView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down