-
Notifications
You must be signed in to change notification settings - Fork 76
Description
Describe your motivation
The context menu method addSeparator() adds an Hr to show a visible separator between two menu items.
Unfortunately, it does not check, if the separator might be the first or last child. In context menus, that show some items only under certain conditions, this may lead to unwanted "artifacts", if not handled properly.
The dev could of course check, if a separator has to be added, but this may lead to unnecessary boilerplate code, if there are several conditions, where items could be shown or not.
Describe the solution you'd like
Since a context menu separator is not a critical element, but more a visual help for the user, it should not be a problem to hide it automatically, when it makes no sense to show a separator.
To achieve this, the context menu should add respective styles:
vaadin-context-menu-list-box {
hr:first-child {
display: none;
}
hr:last-child {
display: none;
}
}Describe alternatives you've considered
Implementing it on my own.
Additional context
No response