-
Notifications
You must be signed in to change notification settings - Fork 863
Open
Labels
design decisionUse this to flag an item that needs input from the design teamUse this to flag an item that needs input from the design team
Description
Problem Statement
If EuiContextMenu renders a lot of items, it can grow too large and it might be desirable to limit its height and make it scrollable. It's possible through applying useEuiOverflowScroll alongside max-height:
Proposed Solution
The idea is to add a flag to EuiContextMenu that controls whether the content can be scrolled or not (or in other words have max height), and applies appropriate styles to the content element.
Use Case
Value / Impact
- It seems valuable both for end-users and to library consumers.
- It could potentially become a pattern for scrollable context menus.
Urgency
It is not a blocker for a large initiative. There is a known workaround.
Do alternatives or workarounds exist?
Currently, it requires targeting an underlying base class and applying background property with !important flag. Codesandbox
<EuiContextMenu
initialPanelId={0}
css={css`
.euiContextMenuPanel > div:not(.euiContextMenuPanel__title) {
max-height: 10rem;
${useEuiOverflowScroll("y")}
}
`}
panels={panels}
>Related code or customizations
reakaleek
Metadata
Metadata
Assignees
Labels
design decisionUse this to flag an item that needs input from the design teamUse this to flag an item that needs input from the design team
