Voice over trait "Chip"

Hi,

When running voice over the trait of the SfChip is "Chip". As far as I know this isn't a native iOS trait. I've also found it impossible to override this "Chip" trait through our effect that sets accessibility traits on various controls. Which basically does the following (for iOS):

Container.AccessibilityTraits = UIAccessibilityTrait.Button;

This effect is on SfChip directly and should alter the trait, but "Chip" just keeps coming back. The container is of type SfButtonRenderer when trying to change the accessibility trait.

Is "Chip" a native trait or is SyncFusion forcing something on this control? Is there a way to make the trait "Button"?

For Android the effect isn't working either, but on Android the trait does not get read. 

Let me know if this is enough information, or if I need to provide more code. Thanks. 


4 Replies

DD Devakumar Dhanapoosanam Syncfusion Team November 23, 2021 06:20 PM UTC

Hi Nina Wip, 
 
Greetings from Syncfusion. 
 
This is a general update to let you know that our support team has taken out your query and currently we are analyzing the reported details at our end, and we will update you the complete status in two business day on November 25, 2021. We appreciate your patience until then. 
 
Meanwhile, if possible, could you please share the SfChip related code snippet details which will be helpful for us to investigate further and provide you a better solution at earliest. 
 
Regards, 
Devakumar D 



NW Nina Wip November 24, 2021 11:10 AM UTC

Hi,


I made a custom SfChipGroup so I could achieve a corner radius, which I took from this forum as wel:

https://www.syncfusion.com/forums/142518/chipcornerradius-property-missing-on-sfchipgroup


In this custom group (added below) I added all the other things I needed for SfChip. As well as specifically setting

AutomationProperties.SetIsInAccessibleTree(e.Element, true); 

because apparently this is not the default for SfChip to be accessible.


With the next line we try to set the accessibility trait to button through an effect. This has worked for any view up until now, but SfChip does not budge from "Chip".

Accessibility.SetAccessibilityTraits(e.Element, Accessibility.AccessibilityTrait.Button);

This is the iOS code for this effect:

private void AddButtonTrait(AccessibilityTrait newTraits)
        {
            if (Control != null)
            {
                var traits = Control.AccessibilityTraits;


                if ((newTraits & AccessibilityTrait.Button) > 0) traits |= UIAccessibilityTrait.Button;


                Control.AccessibilityTraits = traits;
            }
            else if (Container != null)
            {
                Container.AccessibilityTraits = UIAccessibilityTrait.Button;
            }
        }


Full CustomChipGroup code:

public class CustomChipGroup : SfChipGroup
    {
        public static readonly BindableProperty CornerRadiusProperty =
            BindableProperty.Create("CornerRadius", typeof(Thickness), typeof(CustomChipGroup), GetDefaultCornerRadius(), BindingMode.TwoWay, null, null);


        public Thickness CornerRadius
        {
            get { return (Thickness)GetValue(CornerRadiusProperty); }
            set { this.SetValue(CornerRadiusProperty, value); }
        }


        protected override void OnChildAdded(Element child)
        {
            base.OnChildAdded(child);


            child.ChildAdded += Child_ChildAdded;
        }


        private void Child_ChildAdded(object sender, ElementEventArgs e)
        {
            if (e.Element is SfChip)
            {
                (e.Element as SfChip).SetBinding(SfChip.CornerRadiusProperty, new Binding() { Path = "CornerRadius", Source = this, Mode = BindingMode.TwoWay });
                (e.Element as SfChip).FontFamily = (OnPlatform<string>)Application.Current.Resources["BoldFont"];
                (e.Element as SfChip).Margin = 4;
                AutomationProperties.SetIsInAccessibleTree(e.Element, true);
                Accessibility.SetAccessibilityTraits(e.Element, Accessibility.AccessibilityTrait.Button);
            }
        }


        protected override void OnChildRemoved(Element child)
        {
            child.ChildAdded -= Child_ChildAdded;
            base.OnChildRemoved(child);
        }


        private static Thickness GetDefaultCornerRadius()
        {
            if (Device.RuntimePlatform == Device.Android)
            {
                return 40d;
            }


            return 15d;
        }
    }


DD Devakumar Dhanapoosanam Syncfusion Team November 26, 2021 02:58 AM UTC

Hi Nina Wip,

 
Thanks for sharing the requested details. 
 
We need some more time to validate the reported query and we will update you the complete details by November 26, 2021. 
 
Regards, 
Devakumar D 



DD Devakumar Dhanapoosanam Syncfusion Team November 29, 2021 02:57 PM UTC

Hi Nina Wip, 
 
Sorry for the delay. We have tried to achieve your requirement, but we are afraid that with our current implementation in source we can’t change the accessibility traits for chip as Button. 
 
We would like to let you know that in source with our current chip behavior for chip button type we have set “Chip” as the AccessibilityValue in iOS as default. We regret to say that currently we don’t have direct support to customize the chip button type to update as UIAccessibilityTrait.Button.  
 
Regards, 
Devakumar D 


Loader.
Up arrow icon