Visitar URL original
USWDS - Bug: Select padding right causes container overlap · Issue #6605 · uswds/uswds · GitHub
Skip to content

USWDS - Bug: Select padding right causes container overlap #6605

Closed

Description

@jcandan

Describe the bug

The padding-right: units(4); in packages/usa-select/src/styles/_usa-select.scss is causing select boxes to overlap their containers. While, going without that padding seems to have no effect on properly displayed select boxes.

Steps to reproduce the bug

  1. In a USWDS themed Drupal instance, in the Article content type form display settings, set the Author field to Select list.
  2. Visit the add/edit Article form, click the Author tab at the bottom.
  3. Observe the select box overlaps the container.

Expected Behavior

The select box should not overlap the contianer.

Related code

No response

Screenshots

Image

System setup

  • USWDS 3.11.0
  • USWDS Base 3.10.x (Drupal theme)

Additional context

No response

Code of Conduct

Activity

  1. added
    Needs: ConfirmationReported behavior needs validation. Remove after recording reproduction or investigation results.
    on Apr 8, 2026
  2. jcandan commented on Apr 8, 2026

    @jcandan
    Author

    Simply removing the padding-right from packages/usa-select/src/styles/_usa-select.scss fixes the issue without any affect on already correctly-displayed containers.

  3. jcandan commented on Apr 8, 2026

    @jcandan
    Author

    In USWDS Base, it seems padding-right: 8px is right. Not sure what to make of that.

  4. removed
    Needs: ConfirmationReported behavior needs validation. Remove after recording reproduction or investigation results.
    on Jun 23, 2026
  5. ethangardner commented on Jun 23, 2026

    @ethangardner
    Contributor

    Confirmed this issue.

    The overflow is caused by a box-sizing conflict. .usa-select sets width: 100% and padding-right: 2rem (compiled from units(4)). Under box-sizing: border-box (the USWDS default), the padding is included in the width so everything fits. This is controlled by a global theme setting, $theme-global-border-box-sizing. A host environment like Drupal may have CSS from themes or plugins that reset box-sizing back to content-box. In that case, the 2rem padding would get added on top of width: 100%, making the element 32px wider than its container.

    Proposed fix: Add box-sizing: border-box explicitly to the .usa-select rule. This is already the pattern used in usa-combo-box and usa-search for the same reason. The border-box-sizing mixin alone is insufficient protection when embedded in third-party host environments.

  6. added
    Good first issueA bounded task suitable for a first contributor, with clear acceptance criteria and setup guidance.
    Help wantedCommunity contributions are welcome; scope and acceptance criteria should be clear before applying.
    on Jun 23, 2026
  7. VenkateshAddala commented on Jun 26, 2026

    @VenkateshAddala
    Contributor

    Hi maintainers, I’m interested in working on this issue as a first-time contributor. Based on the discussion, I can try adding box-sizing: border-box; to the .usa-select rule in packages/usa-select/src/styles/_usa-select.scss. Please let me know if that approach sounds okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issueA bounded task suitable for a first contributor, with clear acceptance criteria and setup guidance.Help wantedCommunity contributions are welcome; scope and acceptance criteria should be clear before applying.

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions