spectrum-web-components
spectrum-web-components copied to clipboard
[Feat]: Add CSS custom property to set the `max-height` of the `sp-picker` popover
Code of conduct
- [X] I agree to follow this project's code of conduct.
Impacted component(s)
sp-picker
Description of the requested feature
Right now two of our feature teams expressed a need to somehow limit the height of the dropdown popover in sp-picker.
In use cases where there are a lot of options available, the dropdown spawns the entire screen, covering other UI elements which we do not want to be covered.
Looking at sp-combobox, seems like this is already possible there by using --sp-combobox-popover-max-block-size.
Mockups or screenshots
No response
Implementation notes or ideas
Add
sp-popover {
max-block-size: var(--sp-picker-popover-max-block-size);
}
inside picker.css file.
As per Spectrum docs: https://spectrum.adobe.com/page/picker/#Menu-height there is no maximum height specified.
Closing this based on the outcome of #4566