Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-20892

Search form facets are not properly labelled

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 15.7-rc-1
    • 15.4-rc-1
    • Search - Solr
    • Unknown
    • N/A
    • N/A
    • 4.1.2 Name, Role, Value

    Description

      The form elements for the search facets on the Solr search page should be properly linked to their labels. And the labels should use the proper element:

      https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label

      Without the proper semantics, it makes it really difficult for an assistive technology user to select the proper facets for their search.

       

       

      Attachments

        Activity

          [XWIKI-20892] Search form facets are not properly labelled
          Lucas C Charpentier Lucas added a comment - Started PR here: https://github.com/xwiki/xwiki-platform/pull/2187
          Lucas C Charpentier Lucas added a comment - - edited

          I've worked on a solution for this ticket. From what I could see, right clicking and "Open in a new tab" the facet option is one use case of facets (this allows to keep the current results and quickly select a few different facets independently). In regards to this use case, it's important to keep the anchors. So instead of changing their nature (which was the solution I thought would be appropriate and that I described in the ticket topic), I decided to duplicate their content in an invisible label. Anchors can't be used as labels for input elements, there's no way for us to have this double role without duplication. And as far as I know, it seems okay to duplicate the content in anchor, because it's relatively simple. The 'heaviest' thing in the anchor's content would be a small profile picture of the user.

          AFAIK any other solution to create a label would either:

          • ask for a lot of translations
          • Be really complex: filtering out some kind of element and parsing the part we want from the others.

          The structure of the anchor's content will never be too complex and never user generated, so I think it's okay to keep this imperfect implementation. If we deem the cost of duplication is too high for this solution to work, I think we should consider removing the "Search in another tab" use case mentioned above.

          Lucas C Charpentier Lucas added a comment - - edited I've worked on a solution for this ticket. From what I could see, right clicking and "Open in a new tab" the facet option is one use case of facets (this allows to keep the current results and quickly select a few different facets independently). In regards to this use case, it's important to keep the anchors. So instead of changing their nature (which was the solution I thought would be appropriate and that I described in the ticket topic), I decided to duplicate their content in an invisible label. Anchors can't be used as labels for input elements, there's no way for us to have this double role without duplication. And as far as I know, it seems okay to duplicate the content in anchor, because it's relatively simple. The 'heaviest' thing in the anchor's content would be a small profile picture of the user. AFAIK any other solution to create a label would either: ask for a lot of translations Be really complex: filtering out some kind of element and parsing the part we want from the others. The structure of the anchor's content will never be too complex and never user generated, so I think it's okay to keep this imperfect implementation. If we deem the cost of duplication is too high for this solution to work, I think we should consider removing the "Search in another tab" use case mentioned above.

          There is also an issue reported by Axe-core: The images for "user" facets have an alt which is equal to the text next to it. As they are just decorative (in all cases the text next to it will convey the same meaning – id est the user identity), an empty alt can be used on them.

          See https://www.w3.org/WAI/tutorials/images/ for more details on why an empty alt.

          Lucas C Charpentier Lucas added a comment - There is also an issue reported by Axe-core: The images for "user" facets have an alt which is equal to the text next to it. As they are just decorative (in all cases the text next to it will convey the same meaning – id est the user identity), an empty alt can be used on them. See https://www.w3.org/WAI/tutorials/images/ for more details on why an empty alt.
          Lucas C Charpentier Lucas added a comment - - edited

          There is also an issue with the order in the DOM of the item count: it's set in this position using float: right. When reading through the DOM, the order is different from the visual order. It's better to keep it consistent.

          Reference: https://www.w3.org/TR/WCAG20-TECHS/C27.html

          Lucas C Charpentier Lucas added a comment - - edited There is also an issue with the order in the DOM of the item count: it's set in this position using float: right. When reading through the DOM, the order is different from the visual order. It's better to keep it consistent. Reference: https://www.w3.org/TR/WCAG20-TECHS/C27.html

          People

            Lucas C Charpentier Lucas
            Lucas C Charpentier Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: