Visitar URL original
Disabled Select / Dropdown is not grayed out · Issue #4322 · uswds/uswds · GitHub
Skip to content

Disabled Select / Dropdown is not grayed out #4322

Closed

Description

@cameronbuck

Describe the bug

Disabled dropdowns are not grayed out like disabled inputs.

Steps to reproduce the bug

  1. Setting the disabled attribute on a select element.

Expected behavior

  1. A disabled select element should be grayed and have the same styling as disabled inputs.

Screenshots

disabled-dropdown

System setup

  • USWDS version: uswds@2.12.0
  • Device: Macbook
  • Operating system: Catalina (10.15.7)
  • Browser and version: Chrome 93.0.4577.63

Additional context

I was doing some snooping on the HTML / CSS, and it seems like the background-color to gray it out is there but that it's being overriden.

Activity

  1. mejiaj commented on Nov 30, 2021

    @mejiaj
    Contributor

    These are set via the browser styles. I don't see a background color being set on Edge with the browser styles anyways.

    Should we explicitly set disabled styles for text inputs, dropdowns, and form elements in general @thisisdano?

  2. added
    Affects: UsabilityRelates to the usability of our code or components
    and removed on May 6, 2022
  3. moved this from On deck to Scheduled in USWDS Core Project Dataon May 8, 2022
  4. 10 remaining items

  5. amyleadem commented on Sep 30, 2022

    @amyleadem
    Contributor

    @thisisdano @mejiaj
    I have included a screenshot that showcases disabled visual cues in Chrome, Firefox, Safari, and Edge for OS. This screenshot displays the following:

    • Standard .usa-select element
    • Disabled .usa-select element
    • Disabled select element without .usa-select class
    • Standard .usa-input element
    • Disabled .usa-input element
    • Disabled input element without .usa-input class

    Image

    I also have a link to a live demo in PR #4969 in case it is hard to glean the style differences from the screenshot.

    Things to note:

    • Each browser has its own set of default styles for disabled form elements.
    • USWDS overrides some default disabled styles in a way that makes it less clear visually that the element is disabled.

    I lean towards wanting to take a look at developing disabled styles for USWDS form elements that provide clearer visual cues that the element is disabled. However, we would need to be careful of poor contrast ratio and look into accessibility implications.

  6. moved this from On deck to Review in USWDS Core Project Dataon Jan 26, 2023
  7. linked a pull request that will close this issueForm Inputs: Normalize disabled forms styles #5063on Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Affects: UsabilityRelates to the usability of our code or components

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions