Closed r100-stack closed 2 years ago
I dont think we can put max-height
on iui-scroll
class as menu is reused in different components.
i.s. Select
might have different max-height than menu in Table
.
Unless you want to add max-height
in the component itself (Table).
I dont think we can put
max-height
oniui-scroll
class as menu is reused in different components. i.s.Select
might have different max-height than menu inTable
. Unless you want to addmax-height
in the component itself (Table).
Select
, ComboBox
and now columnManager
all use 315px
as a hardcoded inline style. What's the problem with adding it here?
https://github.com/iTwin/iTwinUI/blob/c6e6dc977c2791d4ac4ef7498b3495cd5ef6d5c6/packages/itwinui-css/src/menu/menu.scss#L28-L31
I dont think we can put
max-height
oniui-scroll
class as menu is reused in different components. i.s.Select
might have different max-height than menu inTable
. Unless you want to addmax-height
in the component itself (Table).
Select
,ComboBox
and nowcolumnManager
all use315px
as a hardcoded inline style. What's the problem with adding it here?
Hardcoded number does not sound good. For Table
I would imagine it should be relative to Table
height instead of being hardcoded (which can change depending on the density type too). So I would just think we cannot give a single hardcoded number for all the cases we will reuse Menu
. If we ever add small size to menu item, then it also should influence that...
Instead, having a max-height
per component looks like a better approach. That way we could keep menu
still generic.
Do we have specificity issues if user wants to change max-height
?
What about a CSS variable then? We can call it --iui-menu-height
or something, and we can give it a default value of 315px and change it dynamically in the future if we want.
The specificity will be 0-2-0 with the current css structure, but that's better than an inline style which overrides everything.
PR #740 closes this issue
_Originally posted by @mayank99 in https://github.com/iTwin/iTwinUI-react/pull/756#discussion_r938891896_
The
.iui-scroll
class (DropdownMenu
) currently doesn't have a max height. The suggestion is to put a max height of315px
to the.iui-scroll
class (DropdownMenu
)