Skip to content

Conversation

@chrisolsen
Copy link
Collaborator

@chrisolsen chrisolsen commented Oct 15, 2025

Before (the change)

After (the change)

Make sure that you've checked the boxes below before you submit the PR

  • I have read and followed the setup steps
  • I have created necessary unit tests
  • I have tested the functionality in both React and Angular.

Steps needed to test

  • Testing is needed both with Firefox and Chrome

on:_open={open}
padded="false"
tabindex="-1"
maxwidth=""
Copy link
Collaborator

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?

@chrisolsen chrisolsen force-pushed the chris/menu-button-width-fix branch from fb51ff2 to b282270 Compare October 21, 2025 15:54
@chrisolsen chrisolsen force-pushed the chris/menu-button-width-fix branch from b282270 to f8bd734 Compare October 22, 2025 19:33
@ArakTaiRoth ArakTaiRoth linked an issue Oct 23, 2025 that may be closed by this pull request
import { By } from "@angular/platform-browser";
import { fireEvent } from "@testing-library/dom";

@Component({
Copy link
Collaborator

Choose a reason for hiding this comment

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

This test failed because after angular 20 upgrade, testbed likes to have everything standalone.

After this change it will pass the test:
image

image

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;
Copy link
Collaborator

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.

Copy link
Collaborator

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}
Copy link
Collaborator

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);
Copy link
Collaborator

Choose a reason for hiding this comment

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

For some reason, I'm not sure why. If you use a longer menu action then has room to display on the right side, in Angular it then displays it going to the left, but in React, it seems to display it centred if it can.

Angular:
image

React:
image

style("width", width),
style("min-width", minwidth),
style("max-width", width ? `max(${width}, ${maxwidth})` : maxwidth),
style("max-width", maxwidth === "none" ? "" : maxwidth),
Copy link
Collaborator

Choose a reason for hiding this comment

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

With this change, Dropdown is impacted. The Popover in Dropdown no longer expands to the width of the Dropdown, but instead has a max width of 320px now. I think this might be because Dropdown passes _popoverMaxWidth to the width attribute of Popover, instead of maxwidth.

This PR:
image

Previously:
image

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.

Change icon on MenuButton

4 participants