@@ -31,15 +31,17 @@ export default function PopupsInPopups() {
31
31
32
32
{ withBackdrop && < Dialog . Backdrop render = { < Backdrop /> } /> }
33
33
34
- < DialogPopup >
35
- < div style = { { display : 'flex' , gap : '10px' } } >
36
- < SelectDemo modal = { modal } />
37
- < MenuDemo modal = { modal } />
38
- </ div >
39
- < DialogControls >
40
- < DialogCloseButton > Cancel</ DialogCloseButton >
41
- </ DialogControls >
42
- </ DialogPopup >
34
+ < Dialog . Portal >
35
+ < DialogPopup >
36
+ < div style = { { display : 'flex' , gap : '10px' } } >
37
+ < SelectDemo modal = { modal } />
38
+ < MenuDemo modal = { modal } />
39
+ </ div >
40
+ < DialogControls >
41
+ < DialogCloseButton > Cancel</ DialogCloseButton >
42
+ </ DialogControls >
43
+ </ DialogPopup >
44
+ </ Dialog . Portal >
43
45
</ Dialog . Root >
44
46
</ div >
45
47
</ div >
@@ -48,38 +50,40 @@ export default function PopupsInPopups() {
48
50
49
51
function SelectDemo ( { modal } : Props ) {
50
52
return (
51
- < Select . Root defaultValue = "system" modal = { modal } alignItemToTrigger = { false } >
53
+ < Select . Root modal = { modal } defaultValue = "system" alignItemToTrigger = { false } >
52
54
< Tooltip . Root >
53
55
< Select . Trigger
54
56
aria-label = "Select font"
55
57
render = { < Tooltip . Trigger render = { < Trigger /> } /> }
56
58
>
57
59
< Select . Value placeholder = "System font" />
58
60
< SelectDropdownArrow />
59
- < Tooltip . Portal >
60
- < Tooltip . Positioner sideOffset = { 10 } render = { < TooltipPositioner /> } >
61
- < Tooltip . Popup render = { < TooltipPopup /> } > Choose a font</ Tooltip . Popup >
62
- </ Tooltip . Positioner >
63
- </ Tooltip . Portal >
64
61
</ Select . Trigger >
62
+ < Tooltip . Portal >
63
+ < Tooltip . Positioner sideOffset = { 10 } render = { < TooltipPositioner /> } >
64
+ < Tooltip . Popup render = { < TooltipPopup /> } > Choose a font</ Tooltip . Popup >
65
+ </ Tooltip . Positioner >
66
+ </ Tooltip . Portal >
65
67
</ Tooltip . Root >
66
68
67
- < Select . Positioner sideOffset = { 5 } render = { < Positioner /> } >
68
- < SelectPopup >
69
- < SelectItem value = "system" >
70
- < SelectItemIndicator render = { < CheckIcon /> } />
71
- < Select . ItemText > System font</ Select . ItemText >
72
- </ SelectItem >
73
- < SelectItem value = "arial" >
74
- < SelectItemIndicator render = { < CheckIcon /> } />
75
- < Select . ItemText > Arial</ Select . ItemText >
76
- </ SelectItem >
77
- < SelectItem value = "roboto" >
78
- < SelectItemIndicator render = { < CheckIcon /> } />
79
- < Select . ItemText > Roboto</ Select . ItemText >
80
- </ SelectItem >
81
- </ SelectPopup >
82
- </ Select . Positioner >
69
+ < Select . Portal >
70
+ < Select . Positioner sideOffset = { 5 } render = { < Positioner /> } >
71
+ < SelectPopup >
72
+ < SelectItem value = "system" >
73
+ < SelectItemIndicator render = { < CheckIcon /> } />
74
+ < Select . ItemText > System font</ Select . ItemText >
75
+ </ SelectItem >
76
+ < SelectItem value = "arial" >
77
+ < SelectItemIndicator render = { < CheckIcon /> } />
78
+ < Select . ItemText > Arial</ Select . ItemText >
79
+ </ SelectItem >
80
+ < SelectItem value = "roboto" >
81
+ < SelectItemIndicator render = { < CheckIcon /> } />
82
+ < Select . ItemText > Roboto</ Select . ItemText >
83
+ </ SelectItem >
84
+ </ SelectPopup >
85
+ </ Select . Positioner >
86
+ </ Select . Portal >
83
87
</ Select . Root >
84
88
) ;
85
89
}
@@ -283,8 +287,6 @@ const SelectDropdownArrow = styled(Select.Icon)`
283
287
` ;
284
288
285
289
const Positioner = styled ( 'div' ) `
286
- z-index: 2900;
287
-
288
290
&:focus-visible {
289
291
outline: 0;
290
292
}
@@ -364,7 +366,6 @@ const MenuPopup = styled(Menu.Popup)(
364
366
border: 1px solid ${ theme . palette . mode === 'dark' ? grey [ 700 ] : grey [ 200 ] } ;
365
367
color: ${ theme . palette . mode === 'dark' ? grey [ 300 ] : grey [ 900 ] } ;
366
368
box-shadow: 0px 4px 30px ${ theme . palette . mode === 'dark' ? grey [ 900 ] : grey [ 200 ] } ;
367
- z-index: 1;
368
369
transform-origin: var(--transform-origin);
369
370
opacity: 1;
370
371
transform: scale(1, 1);
@@ -460,7 +461,6 @@ const DialogPopup = styled(Dialog.Popup)(
460
461
font-family: "IBM Plex Sans", sans-serif;
461
462
transform: translate(-50%, -50%);
462
463
padding: 16px;
463
- z-index: 2100;
464
464
` ,
465
465
) ;
466
466
@@ -491,9 +491,7 @@ const DialogCloseButton = styled(Dialog.Close)(
491
491
` ,
492
492
) ;
493
493
494
- const TooltipPositioner = styled ( 'div' ) `
495
- z-index: 3000;
496
- ` ;
494
+ const TooltipPositioner = styled ( 'div' ) `` ;
497
495
498
496
const TooltipPopup = styled ( 'div' ) `
499
497
box-sizing: border-box;
@@ -537,5 +535,4 @@ const Backdrop = styled('div')`
537
535
position: fixed;
538
536
inset: 0;
539
537
backdrop-filter: blur(4px);
540
- z-index: 2000;
541
538
` ;
0 commit comments