-
Notifications
You must be signed in to change notification settings - Fork 34
fix: ensure menu-button's menu width fits the largest menu item #3109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: alpha
Are you sure you want to change the base?
Conversation
047d30b to
fb51ff2
Compare
| on:_open={open} | ||
| padded="false" | ||
| tabindex="-1" | ||
| maxwidth="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment or even better with maxwidth="none" (add a new option "none" for Popover), otherwise later we will forget why we have this added at the first place?
fb51ff2 to
b282270
Compare
b282270 to
f8bd734
Compare
| import { By } from "@angular/platform-browser"; | ||
| import { fireEvent } from "@testing-library/dom"; | ||
|
|
||
| @Component({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| padding: 0 var(--goa-button-padding-lr); | ||
| gap: var(--goa-button-gap); | ||
| align-items: center; /* for leading and trailing icon vertical alignment */ | ||
| white-space: nowrap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of this, long menu items don't wrap, and the Popover itself doesn't respect the max-width set, so it can go grow forever. This especially leads to issues with mobile, where the menu can literally be off screen if it's large enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also because of this, the Popover can expand to infinite width potentially, as there's nothing that can be used to control its width, so it just grows infinitely to fit the content.
| slot="target" | ||
| leadingicon={leadingIcon} | ||
| {type} | ||
| trailingicon={_icon} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The acceptance criteria on the story asks that trailingicon can be changed by the user as well, so it doesn't necessarily have to be the chevron-down, this would instead be itss default.
| font: var(--goa-button-text); | ||
| height: var(--goa-button-height); | ||
| letter-spacing: var(--goa-button-letter-spacing); | ||
| padding: 0 var(--goa-button-padding-lr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| style("width", width), | ||
| style("min-width", minwidth), | ||
| style("max-width", width ? `max(${width}, ${maxwidth})` : maxwidth), | ||
| style("max-width", maxwidth === "none" ? "" : maxwidth), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.






Before (the change)
After (the change)
Make sure that you've checked the boxes below before you submit the PR
Steps needed to test