Skip to content

fix(navigation): dropdown min-width and boundary checking (#5758)#5760

Open
YASH-MOHARIR wants to merge 1 commit intocanonical:mainfrom
YASH-MOHARIR:fix/5758-dropdown-navigation-min-width
Open

fix(navigation): dropdown min-width and boundary checking (#5758)#5760
YASH-MOHARIR wants to merge 1 commit intocanonical:mainfrom
YASH-MOHARIR:fix/5758-dropdown-navigation-min-width

Conversation

@YASH-MOHARIR
Copy link
Copy Markdown

Resolves #5758

  • Move min-width: 100% into the desktop media query where position: absolute is set, ensuring the dropdown is never narrower than its trigger element

  • Add max-width: $text-max-width (40em) to prevent dropdowns from becoming excessively wide on large screens

  • Add .is-right-overflow CSS class for boundary checking support

  • Add applyBoundaryChecking() JS function that detects when a dropdown would overflow the right edge of the viewport and flips it to right-aligned

    How to test

  1. Click "Design practice" - dropdown should match the parent width, not shrink to fit "User research"
  2. Click "Brand" - short parent with short children, dropdown should still match "Brand" width
  3. Click "Open design" near the right side - dropdown should stay within the viewport (boundary checking)
Screenshot 2026-02-26 011339

…ary checking (canonical#5758)

- Move min-width: 100% into the desktop media query where position: absolute
  is set, ensuring the dropdown is never narrower than its trigger element
- Add max-width: -max-width (40em) to prevent dropdowns from becoming
  excessively wide on large screens
- Add .is-right-overflow CSS class for boundary checking support
- Add applyBoundaryChecking() JS function that detects when a dropdown would
  overflow the right edge of the viewport and flips it to right-aligned

Resolves canonical#5758
@webteam-app
Copy link
Copy Markdown

YASH-MOHARIR is not a collaborator of the repo

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Component amendment]: Dropdown navigation min width

2 participants