You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All `Popup` components (`Popover`, `Tooltip`, `Menu`): 4 new positions `auto-` to have auto-placement but give priority to a direction. For instance, `auto-bottom` will try to place the popup beneath the disclosure first, if there is not enough place it will try top, then left, then right.
6
+
The priorities are :
7
+
-`auto-bottom` : bottom > top > left > right
8
+
-`auto-left` : left > right > top > bottom
9
+
-`auto-right` : right > left > top > bottom
10
+
-`auto` and `auto-top` : top > bottom > left > right
11
+
12
+
**BREAKING CHANGE**
13
+
`Menu`: prop `noShrink` renamed `shrink` with opposite behavior
Information with a very long name. Lorem ipsum dolor sit amet,
25
+
consectetur adipiscing elit.
26
+
</Menu.Item>
27
+
<Menu.Itemborderlesskey="power on">
28
+
Power on
29
+
</Menu.Item>
30
+
</Menu>
31
+
</>
32
+
<>
33
+
Placement = "right": not enough room on the right but force
34
+
placement on the right
35
+
<Menudisclosure={disclosure}placement="right">
36
+
<Menu.Itemborderlesskey="borderless">
37
+
Information with a very long name. Lorem ipsum dolor sit amet,
38
+
consectetur adipiscing elit.
39
+
</Menu.Item>
40
+
<Menu.Itemborderlesskey="power on">
41
+
Power on
42
+
</Menu.Item>
43
+
</Menu>
44
+
</>
45
+
</Stack>
46
+
<Stack
47
+
alignItems="center"
48
+
justifyContent="center"
49
+
style={{
50
+
marginTop: 100,
51
+
}}
52
+
>
53
+
You can play with the placement here using storybook controls
54
+
<Menudisclosure={disclosure}{...props}>
55
+
<Menu.Itemborderlesskey="borderless">
56
+
Information with a very long name. Lorem ipsum dolor sit amet,
57
+
consectetur adipiscing elit.
58
+
</Menu.Item>
59
+
<Menu.Itemborderlesskey="power on">
60
+
Power on
61
+
</Menu.Item>
62
+
</Menu>
63
+
</Stack>
64
+
</>
65
+
)
66
+
67
+
Placement.parameters={
68
+
docs: {
69
+
description: {
70
+
story: `You can choose to place automatically the menu or manually. There are for manual placements: "top", "bottom", "left" and "right".
71
+
There are five modes of auto-placement: "auto", "auto-left", "auto-right", "auto-top", and "auto-bottom". Those "auto-" allow to give a prioriry to the direction. For instance, auto-bottom will try to place the popup beneath the disclosure first, if there is not enough place it will try top, then left, then right.
72
+
The priorities are :
73
+
<ul>
74
+
<li> auto-bottom : bottom > top > left > right</li>
75
+
<li> auto-left : left > right > top > bottom</li>
76
+
<li> auto-right : right > left > top > bottom</li>
77
+
<li> auto and auto-top : top > bottom > left > right</li>
disclosure={<Button>default with placement bottom</Button>}
19
+
placement="bottom"
20
+
>
21
+
<Menu.Item>item</Menu.Item>
22
+
<Menu.Item>item</Menu.Item>
23
+
<Menu.Item>item</Menu.Item>
24
+
<Menu.Item>item</Menu.Item>
25
+
<Menu.Item>item</Menu.Item>
26
+
27
+
<Menu.Item>item</Menu.Item>
28
+
</Menu>
29
+
30
+
<Menu
31
+
disclosure={<Button>shrink=true and placement bottom</Button>}
32
+
placement="bottom"
33
+
shrink
34
+
>
18
35
<Menu.Item>item</Menu.Item>
19
36
<Menu.Item>item</Menu.Item>
20
37
<Menu.Item>item</Menu.Item>
@@ -30,7 +47,7 @@ Shrink.parameters = {
30
47
docs: {
31
48
description: {
32
49
story:
33
-
'When the menu is at the bottom of a page (not possible to scroll down further), with `placement = "bottom"`, it will shrink so that it does not cause overflow. It is possible to remove this feature using prop `noShrink`',
50
+
'When the menu is at the bottom of a page (not possible to scroll down further), with `placement = "bottom"`, it can shrink so that it does not cause overflow. Activate this feature using prop `shrink`',
0 commit comments