Visitar URL original
Fix select overflow by setting border-box sizing by VenkateshAddala · Pull Request #6736 · uswds/uswds · GitHub
Skip to content

Fix select overflow by setting border-box sizing - #6736

Merged
annepetersen merged 2 commits into
uswds:developfrom
VenkateshAddala:fix-select-border-box-sizing
Jun 29, 2026
Merged

annepetersen merged 2 commits into
uswds:developfrom
VenkateshAddala:fix-select-border-box-sizing

Conversation

@VenkateshAddala

Copy link
Copy Markdown
Contributor

Summary

Updated the Select component to explicitly use box-sizing: border-box, which prevents select elements from overflowing their containers in host environments where global box sizing may be reset.

Breaking change

This is not a breaking change.

Related issue

Closes #6605

Related pull requests

None.

Preview link

Preview link: Not available.

Problem statement

The Select component can overflow its container in host environments that reset box sizing to content-box. Since .usa-select uses width: 100% with right padding for the dropdown icon, the padding can be added outside the element width and cause layout overlap.

Solution

Added box-sizing: border-box; directly to the .usa-select rule so the component keeps its padding inside the declared width. This preserves the existing padding-right behavior while making the component more resilient in third-party host environments.

Major changes

  • Added box-sizing: border-box; to packages/usa-select/src/styles/_usa-select.scss.

Testing and review

  • Verified the change is limited to packages/usa-select/src/styles/_usa-select.scss.
  • Not run locally; change is a one-line Sass fix.

@github-actions

github-actions Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

✅ All commits on this PR have a verified signature. Thanks!

@github-actions github-actions Bot added the Needs: Author Response 🔴 Waiting on a specific author action; also used by commit-signature automation. label Jun 26, 2026
@VenkateshAddala

Copy link
Copy Markdown
Contributor Author

Hi maintainers, I opened this PR for #6605. Please let me know if any changes are needed. Thank you!

@VenkateshAddala
VenkateshAddala force-pushed the fix-select-border-box-sizing branch from af33816 to 8bd4468 Compare June 26, 2026 01:57
@github-actions github-actions Bot removed the Needs: Author Response 🔴 Waiting on a specific author action; also used by commit-signature automation. label Jun 26, 2026

@heymatthenry heymatthenry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @VenkateshAddala! This works, but it might be better to put the line inside the %block-input-styles mixin directly (in _forms.scss). I think the select probably isn't the only place this is happening.

WDYT @ethangardner?

@github-project-automation github-project-automation Bot moved this from Triage to In progress in USWDS Core Project Data Jun 26, 2026
@VenkateshAddala

Copy link
Copy Markdown
Contributor Author

Thanks for the review @heymatthenry. I moved box-sizing: border-box; into %block-input-styles in _forms.scss and removed the select-specific change.

@heymatthenry heymatthenry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @VenkateshAddala! LGTM!

@VenkateshAddala

Copy link
Copy Markdown
Contributor Author

Thank you for the review and approval @heymatthenry. I’ll wait for the remaining workflow approval/merge from the maintainers.

@annepetersen
annepetersen merged commit dcbdd65 into uswds:develop Jun 29, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Fed Final Review in USWDS Core Project Data Jun 29, 2026
@chandracarney chandracarney moved this from Fed Final Review to Done in USWDS Core Project Data Jul 20, 2026
@ethangardner ethangardner added this to the uswds 3.14.0 - Aug 2026 milestone Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

USWDS - Bug: Select padding right causes container overlap

5 participants