Xamarin.forms: Entry Placeholder doesn't respond to FlowDirection RTL

Created on 20 Jul 2018  路  12Comments  路  Source: xamarin/Xamarin.Forms

Description

Entry Placeholder doesn't respond to FlowDirection.

When fixing this issue in the Control Gallery the solution needs to be verified against not having targetSdk set and also having targetSdk set in the Android Manifest to >= 17

Because RTL in Android will act differently based on the targetSDK

Steps to Reproduce

Placeholder Reproduction Steps

  1. Add a placeholder to any entry text <Entry Placeholder="[email protected]" Text="{Binding UserEmail, Mode=TwoWay}" Keyboard="Email" />
  2. change the FlowDirection to RTL: FlowDirection = FlowDirection.RightToLeft;

Expected Behavior

The placeholder should flow from right to left as other views.

Actual Behavior

The placeholder doesn't respond to the change in flow direction.

Basic Information

  • Version with issue:Xamarin forms 3.0+, tested with latest stable 3.1 too.3.2 pre and nightly 3.3 pre.
  • Last known good version: -
  • IDE:Visual Studio For Mac
  • Platform Target Frameworks:

    • iOS: tested on iOS 11 and some older versions

    • Android: Tested on Android 8 and Android 7

  • Affected Devices: All Devices

Screenshots

As you can see in the image, the first label is normal label which follows rtl fine. but the second one is not as well as the placeholders in the entries
Simulator_Screen_Shot_i_Phone_8_2018_07_20_at_22_36_47

Reproduction Link

Create a Xamarin forms project and add the above code in the reproduction steps section.
PlaceholderRTL.zip

rtl 3 help wanted in-progress inactive Android iOS 馃崕 bug up-for-grabs

All 12 comments

@samhouts you are the expert in this regard, please check it out.

@ali-h2010 can you test this with the latest 3.2 pre1 ?

Or try the latest nightly build
https://blog.xamarin.com/try-the-latest-in-xamarin-forms-with-nightly-builds/

There have been a couple other issues opened up around this that were resolved when tested against latest builds

@PureWeen , Thanks, I will try that. I haven't found anyone complaining about the formatted text not responding to RTL but if you find this issue a duplicate, than, I can delete it and share my testing on the first issue.

Here's one
https://github.com/xamarin/Xamarin.Forms/issues/3311

I'll close this one for now.
If you are still seeing the issue with latest builds we can re-open

@PureWeen , I tested with the latest Xamarin forms 3.2 pre (not nightly) and the formatted text issue was resolved in that version. but, the placeholder is still not responding.

I also got many strange errors on external plugins that I was using like the segmented button and some syncfusion plugins such as:
No property, bindable property, or event found for 'ItemSpacing', or mismatching type between value and property.

No need to open and issue about them though because it's still prerelease.
I will test with nightly version next

@PureWeen , I tested with nightly and the placeholders are not behaving as expected. Please reopen this issue and I will edit it to focus on the placeholders only.

@ali-h2010 what do you have your targetSDK set to in your manifest?

The android:targetSdkVersion has to be >= 17 in order for the RTL to fully wor

@PureWeen.
The Minimum Android Version is API 17 and Target is API 26.
Issue is also apparent in iOS.

@jafarullahag i fixed the issue with Custom Renderer and changing the alignment.
Xamarin Forms is open source so anyone can contribute to the development and improvement of the framework. But my solutions are not clean and i don't have a good understand of the whole process. This could change once i get certified in Xamarin.

Thanks for the support Jafar

@jafarullahag Thanks for the great demo. I didn't implement changing the language in the same page. This is awesome.

I am facing similar problems in multiple places. I think the problem lies in using DataTemplate. For some reason DataTemplate does not inherit FlowDirection property.

Was this page helpful?
0 / 5 - 0 ratings