Unplanned
Last Updated: 08 May 2020 17:22 by ADMIN
Sunil Sutar
Created on: 23 Apr 2019 15:19
Category: Grid
Type: Bug Report
3
With aria support enabled screen readers read href attribute of GridButtonColumn links if no text is defined
If anchor links of GridButtonColumn do not define a text links are still rendered and screen readers read their href attribute. Anchor links with no text could define an attribute area-hidden="true".
2 comments
ADMIN
Peter Milchev
Posted on: 30 Apr 2019 10:06
Hello Sunil,

I am sharing here the possible workarounds that were discussed in the support thread: 

To avoid this problem, using the ItemDataBound event, access and then check whether the anchor tag (LinkButton) has Text, and in case it does not, hide the link using the Visible property (to find out more about accessing controls, cells, and values check out the Accessing Cells and Rows article):


protected void SearchGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem dataItem = e.Item as GridDataItem;
  
        GridTableCell cell = dataItem["Gender"] as GridTableCell;
  
        LinkButton linkBtn = cell.Controls[0] as LinkButton;
  
        if (string.IsNullOrEmpty(linkBtn.Text))
        {
            linkBtn.Visible = false;
            // or just hide it from screen readers like JAWS
            // linkBtn.Attributes.Add("aria-hidden", "true");
        }
    }
}

Regards,
Peter Milchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Sunil Sutar
Posted on: 23 Apr 2019 17:01

This mainly happens when JAWS Links List is opened (Insert+F7), it shows up all the href mentioning the href value as is.

--

Sunil