Skip to content

Conversation

@web-padawan
Copy link
Member

@web-padawan web-padawan commented Nov 11, 2025

Description

Part of #10417

if no item has children, remove the space after items (the placeholder for submenu indicator) [0.5 day]

Type of change

  • Refactor

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks kinda out of place.. should this logic also apply on the left side (check mark) if none of the menu entries are checkable?

Copy link
Member Author

Choose a reason for hiding this comment

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

In theory yes, but that's a bit more complicated. There is an existing issue: #613

In short, the web component doesn't have a way to detect when the item is checkable, so we assume they are by default. This is also related to some missing a11y semantics - see #165 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

That was also the idea. But currently it’s not possible to know with CSS if an item is checkable.

Copy link
Member

Choose a reason for hiding this comment

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

In the meantime, I think we should make it easy to hide that empty space in a menu if the developer knows none of the items are checkable. I added a class name to each individual item in StarPass in such cases, but I think it would be easier if it could be applied on the whole menu. But there’s no API for that, is there?

Screenshot 2025-11-12 at 10 45 54

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no API in the web component indeed. Let's maybe discuss it in #613.

@jouni
Copy link
Member

jouni commented Nov 12, 2025

Now I’m wondering, why do we even add that pseudo element by default on items that don't have sub-menu? Couldn't we just not do that, and only add it to items that have [aria-haspopup="true"]? No need for slot styles then, right?

@web-padawan
Copy link
Member Author

@jouni Thanks, it does make sense. Updated base styles and reverted addition of these slot styles.
There is still a TODO about [menu-item-checked] that would need to be addressed separately.

@web-padawan web-padawan changed the title refactor: hide submenu indicator if there are no child items refactor: only show submenu indicator if there are child items Nov 12, 2025
@sonarqubecloud
Copy link

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.

4 participants