Skip to content

feat: introduce minWidth and maxWidth properties#4239

Open
mxschll wants to merge 34 commits intomainfrom
dev-v3-schomax-dropdown-sizing
Open

feat: introduce minWidth and maxWidth properties#4239
mxschll wants to merge 34 commits intomainfrom
dev-v3-schomax-dropdown-sizing

Conversation

@mxschll
Copy link
Member

@mxschll mxschll commented Feb 11, 2026

Description

This PR introduces minWidth and maxWidth sizing props for the Dropdown component, replacing the previous boolean-based approach.

Changes Made

Related

[Quip proposal: RGJgABPXohP8]

How has this been tested?

  • Manual testing
  • Unit tests green
  • Integration tests green
  • Pipeline green (though some flakiness)
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

open={canBeOpened && isOpen}
stretchWidth={false}
stretchTriggerHeight={variant === 'navigation'}
minWidth={expandToViewport ? undefined : 'trigger'}
Copy link
Member Author

Choose a reason for hiding this comment

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

When expandToViewport is enabled, the dropdown adjusts its size based on its content. This preserves the current behavior. The functionality has simply been moved from the dropdown component to this specific line of code.

stretchWidth={!dropdownWidth}
stretchBeyondTriggerWidth={true}
minWidth={dropdownWidth ? dropdownWidth : expandToViewport ? undefined : 'trigger'}
maxWidth={getBreakpointValue('xxs')} // AWSUI-19898
Copy link
Member Author

Choose a reason for hiding this comment

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

Sizing logic has been moved from the dropdown component to these props. The current behavior remains unchanged: when minimum width exceeds maximum width, the minimum width value takes precedence (default css behavior).

}
open={multiselectProps.isOpen}
minWidth={expandToViewport ? undefined : 'trigger'}
maxWidth={getBreakpointValue('xxs')} // AWSUI-19898
Copy link
Member Author

Choose a reason for hiding this comment

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

Sizing logic has been moved from the dropdown component to these props. The current behavior remains unchanged: when minimum width exceeds maximum width, the minimum width value takes precedence (default css behavior).

stretchTriggerHeight={!!__inFilteringToken}
stretchBeyondTriggerWidth={true}
minWidth={expandToViewport ? undefined : 'trigger'}
maxWidth={getBreakpointValue('xxs')} // AWSUI-19898
Copy link
Member Author

Choose a reason for hiding this comment

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

Sizing logic has been moved from the dropdown component to these props. The current behavior remains unchanged: when minimum width exceeds maximum width, the minimum width value takes precedence (default css behavior).

});

test('cannot expand beyond the XXS breakpoint', () => {
test('can expand to content width', () => {
Copy link
Member Author

@mxschll mxschll Feb 12, 2026

Choose a reason for hiding this comment

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

The default behavior changed, so this test had to be adapted accordingly.

@mxschll mxschll marked this pull request as ready for review February 12, 2026 18:10
@mxschll mxschll requested a review from a team as a code owner February 12, 2026 18:10
@mxschll mxschll removed the request for review from a team February 12, 2026 18:11
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.

1 participant