Xamarin.forms: [Bug] AutomationProperties on Button still visible on Android if Text Property is empty

Created on 8 Oct 2019  ·  26Comments  ·  Source: xamarin/Xamarin.Forms

Description

This error is hapenning in the actual version of xamarin forms.

Basic Information

  • IDE: Visual Studio 2019
  • Platform Target Frameworks:

    • Android: Android 10 (API Level 29)
  • Nuget Packages: Xamarin.Forms (4.2.0.848062)

  • Tested Devices: Emulators with Android 10 and 9. Nokia x6 with Android 9.

Screenshots

image

Reproduction Link

AppTeste.zip

a11y 🔍 in-progress Android bug

Most helpful comment

I'd like to work om this as I'm focused on accessibility improvements on Xamarin.Forms

All 26 comments

Seems to happen indeed, only on Android. What I somehow suspect is that we somehow, somewhere assign this to a visible property whenever that is empty? Need to investigate a bit on that.

As a workaround you could enter a space in your Text property for now.

I'd like to work om this as I'm focused on accessibility improvements on Xamarin.Forms

By all means, please go ahead! I'll assign it to me for now so no one will snatch it from you. If, for some reason, you can't finish it please let me know :)

If help you guys, I run into another issue related to this. It seems like the properties are only hide but definily is on the UI. In the sample I'll send, the same button with and without AutomationProperties, has different width value as you can see in the screenshot.

ScreenShot

image

Reproduction Link

AppTeste.zip

I'm not sure what you're trying to say. You mean using the AutomationProperties are impacting the width?

I'm not sure what you're trying to say. You mean using the AutomationProperties are impacting the width?

We had a problem like that last year; maybe this is a similar situation? https://github.com/xamarin/Xamarin.Forms/issues/2580

Exactly. In the code that's in the sample I've sended, you can see that the two buttons that reproduce this images, are equals with the only difference being the automationproperties in the last one.

See the folling code:

```

I wonder if this is showing up again because the fast renderers are the default now? Looks like Rui fixed this in the older LabelRenderer; maybe the same fix needs to be applied to the fast renderer: https://github.com/xamarin/Xamarin.Forms/pull/4433/files#diff-c754c889f501d0bbd657ea1ca0ad3370

I think it's the same @hartez !

I wonder if this is showing up again because the fast renderers are the default now? Looks like Rui fixed this in the older LabelRenderer; maybe the same fix needs to be applied to the fast renderer: https://github.com/xamarin/Xamarin.Forms/pull/4433/files#diff-c754c889f501d0bbd657ea1ca0ad3370

I can confirm that using the flag "UseLegacyRenderers", the UI show as expected!

Nice catch @hartez!

@magoolation this should be an easy fix then :) are you able to implement this anytime soon? Else to get this bug out of the way ASAP I can do it for you

My plan is to do it next week as I’m attending to a conference until Sunday

On Thu, 10 Oct 2019 at 03:28 Gerald Versluis notifications@github.com
wrote:

Nice catch @hartez https://github.com/hartez!

@magoolation https://github.com/magoolation this should be an easy fix
then :) are you able to implement this anytime soon? Else to get this bug
out of the way ASAP I can do it for you


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/xamarin/Xamarin.Forms/issues/7875?email_source=notifications&email_token=AAEY5PGD7CT7VXSLNT56YX3QN3DRPA5CNFSM4I6SR7WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA26HQQ#issuecomment-540402626,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAEY5PEREPTPSWB5CZ2D6I3QN3DRPANCNFSM4I6SR7WA
.

Awesome! Have a great conference and looking forward to your PR then

@magoolation Not trying to put pressure on you, sorry! But did you make any progress with this yet? Please let us know if you need help or want us to take over. Thanks!

Thank you for asking.
I couldn’t find a solution yet
If you can give me a direction to follow i will aprecia-te it
But if you think it will be easier solve it by yourself go ahead

On Mon, 28 Oct 2019 at 07:04 Gerald Versluis notifications@github.com
wrote:

@magoolation https://github.com/magoolation Not trying to put pressure
on you, sorry! But did you make any progress with this yet? Please let us
know if you need help or want us to take over. Thanks!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/xamarin/Xamarin.Forms/issues/7875?email_source=notifications&email_token=AAEY5PFLND4QFQEBSTN3NOTQQ22JFA5CNFSM4I6SR7WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECMKU4A#issuecomment-546876016,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAEY5PABMZBWKQ7RM7AARS3QQ22JFANCNFSM4I6SR7WA
.

Did you see this comment from a little bit earlier? You can find it here: https://github.com/xamarin/Xamarin.Forms/issues/7875#issuecomment-540141157

Although I do see they are talking about a Label and not a Button there... So this code might be needed in the LabelRenderer in the FastRenderers folder but also on the button?

I didn't test the label. But I'm sure the button error was fixed in old render.
It seems like this is the right commit in which the fix was done:
https://github.com/xamarin/Xamarin.Forms/pull/4094/commits/ff13c49b53bb258e824d9e51cd2f6378a5d227c1 @jfversluis @magoolation

Did you see this comment from a little bit earlier? You can find it here: #7875 (comment)

Although I do see they are talking about a Label and not a Button there... So this code might be needed in the LabelRenderer in the FastRenderers folder but also on the button?

Thanks @MathewLC !

Let me know if you can make any progress with this @magoolation. Else I will have a go at this to get this a11y bug out of the way!

Thank you for the help. I'll give it a try tonight and let you know if I
need something else.

Em seg, 28 de out de 2019 às 09:46, Gerald Versluis <
[email protected]> escreveu:

Did you see this comment from a little bit earlier? You can find it here: #7875
(comment)
https://github.com/xamarin/Xamarin.Forms/issues/7875#issuecomment-540141157

Although I do see they are talking about a Label and not a Button
there... Maybe I need to do some more research myself :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/xamarin/Xamarin.Forms/issues/7875?email_source=notifications&email_token=AAEY5PGUCXH6AD5IZNM5FUDQQ3NJDA5CNFSM4I6SR7WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECMXYXI#issuecomment-546929757,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAEY5PD3WHF7RAZ5QDC2FFLQQ3NJDANCNFSM4I6SR7WA
.

I can confirm that this is happening with Labels as well. Here is my test code:

        <StackLayout
            VerticalOptions="FillAndExpand"
            Orientation="Vertical"
            BackgroundColor="Yellow"
            Spacing="10" >
            <Label x:Name="FirstLabel"
                Text="First Label"
                HorizontalOptions="Center"
                Font="12" 
                   BackgroundColor="Aqua"/>
            <Label x:Name="SecondLabel"
                Text="Second Label"
                HorizontalOptions="Center"
                Font="12" 
                   BackgroundColor="BlueViolet"
            AutomationProperties.Name="This is a really long Automation Properties Name, It's so long it takes up two lines"/>
            <Label x:Name="ThirdLabel"
                Text="Third Label"
                HorizontalOptions="Center"
                Font="12" 
                   BackgroundColor="ForestGreen"/>
            <Label x:Name="FourthLabel"
                Text="Fourth Label"
                HorizontalOptions="Center"
                Font="12" 
                   BackgroundColor="HotPink"
                   AutomationProperties.Name="Short Name"/>
        </StackLayout>
        public MainPage()
        {
            InitializeComponent();
            AutomationProperties.SetName(FirstLabel, "This is a really long Automation Properties Name, It's so long it takes up two lines");
            AutomationProperties.SetName(ThirdLabel, "Short Name");
        }

image

@czuck I think you can wait and see if the pull request that reference this bug fix it in the next version of xamarin forms(4.4.0). If not you can open another Issue and reference this.

Labels are working properly with 4.4.0-pre3! Thanks!

Thanks for letting us know @czuck ! @MathewLC can you confirm and update this issue appropriately?

@jfversluis I tested with the last release version of forms and in fact labels are working but buttons aren't. You guys didn't merge this yet, am I right?

Whoops, no the PR is still open and I see it was just waiting for my review 😱 sorry about that! I'll see to it that I do that ASAP. Thanks for the ping @MathewLC !

closed by #8368

Was this page helpful?
0 / 5 - 0 ratings