Skip to content
TheChatArchiveThe Chat Archive
Geminigemini-2.5-flash· GoogleHugging Face LMArena Human Preference 140K

why am i getting this WCAG error from ARC toolkit test? 4 Alert(s)Multiple naming…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with chatgpt-4o-latest-20250326’s answer.
  1. User

    why am i getting this WCAG error from ARC toolkit test?

    4 Alert(s)Multiple naming techniques used Description: The form control uses multiple naming techniques. WCAG 2.2 Success Criterion:A 4.1.2 Name, Role, Value External link

  2. Gemini Assistant

    You're getting this "Multiple naming techniques used" alert because your div elements, which are acting as ARIA comboboxes, have both aria-label and aria-labelledby attributes on the same element.

    Let's break down the example:

    <div tabindex="0" role="combobox" 
         aria-controls="templateName-select" 
         aria-expanded="false" 
         aria-haspopup="listbox" 
         aria-label="Template Name" 
         aria-labelledby="templateName-select" 
         id="templateName-select" 
         class="MuiSelect-select MuiSelect-outlined MuiInputBase-input MuiOutlinedInput-input css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input">
    </div>
    

    The Conflict:

    1. aria-label="Template Name": This attribute directly provides an accessible name for the element. Screen readers would announce "Template Name".
    2. aria-labelledby="templateName-select": This attribute refers to another element (or elements) by their ID to construct the accessible name. In this case, it's referring to id="templateName-select".

    Why this is an issue (or at least an alert):

    • Redundancy: You are providing two ways to name the same element. While ARIA has precedence rules (typically aria-labelledby takes precedence over aria-label), having both is redundant and can lead to confusion for developers or potentially unexpected behavior with some assistive technologies or browser versions.
    • Best Practice: It's best practice to choose one clear, unambiguous method for providing an accessible name.
    • Misuse of aria-labelledby (in this specific case): The aria-labelledby attribute is designed to point to another element that serves as the label. In your code, aria-labelledby="templateName-select" is pointing to the element itself because the element also has id="templateName-select". This is generally not how aria-labelledby is used; it's for referencing a separate visible label. If the element itself contained text, aria-labelledby referencing its own ID might make sense to ensure that text is used as the label, but an empty div relies on ARIA attributes for its name.

    How to fix it:

    You need to decide which naming technique is appropriate for your specific use case and remove the other.

    Option 1: Use aria-label (Recommended if "Template Name" is the desired label and there's no separate visual label element)

    If "Template Name" is simply the accessible name you want this combobox to have, and there isn't a separate, visually rendered label element on the page that says "Template Name" and is linked to this combobox, then aria-label is the simplest and clearest choice.

    <div tabindex="0" role="combobox" 
         aria-controls="templateName-select" 
         aria-expanded="false" 
         aria-haspopup="listbox" 
         aria-label="Template Name" 
         id="templateName-select" 
         class="MuiSelect-select MuiSelect-outlined MuiInputBase-input MuiOutlinedInput-input css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input">
    </div>
    <!-- Removed aria-labelledby -->
    

    Option 2: Use aria-labelledby (Recommended if there is a separate, visible label element)

    If you have a visible label element on the page that contains the text "Template Name" (e.g., a label or span), and you want to associate that visible label with your combobox for accessibility, then you should use aria-labelledby and point it to the ID of that separate label element.

    Example:

    <label id="templateName-label" for="templateName-select">Template Name</label>
    <div tabindex="0" role="combobox" 
         aria-controls="templateName-select" 
         aria-expanded="false" 
         aria-haspopup="listbox" 
         aria-labelledby="templateName-label" 
         id="templateName-select" 
         class="MuiSelect-select MuiSelect-outlined MuiInputBase-input MuiOutlinedInput-input css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input">
    </div>
    <!-- Removed aria-label, aria-labelledby now points to the label's ID -->
    

    Note: In this specific case, your aria-labelledby was pointing to id="templateName-select", which is the ID of the combobox itself. This implies there's likely no separate label element being referenced, making Option 1 or a re-evaluation of your labeling structure more appropriate.

    In summary: The alert is a good prompt from ARC Toolkit to review your accessible naming strategy and ensure clarity and efficiency. For your current code, given that aria-labelledby points to the element's own ID, the simplest and most common fix is to remove aria-labelledby and rely solely on aria-label.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.