File tree Expand file tree Collapse file tree 2 files changed +36
-4
lines changed
code/core/src/components/components Expand file tree Collapse file tree 2 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export const Overlay = styled.div<{
8383 inset : 0 ,
8484 width : '100%' ,
8585 height : '100%' ,
86- zIndex : 90 ,
86+ zIndex : 100000 ,
8787 '@media (prefers-reduced-motion: no-preference)' : {
8888 animation :
8989 $status === 'exiting' || $status === 'preExit'
@@ -106,7 +106,7 @@ export const Container = styled.div<{
106106 boxShadow : '0px 4px 67px 0px #00000040' ,
107107 position : 'absolute' ,
108108 overflow : 'auto' ,
109- zIndex : 100 ,
109+ zIndex : 100000 ,
110110
111111 '&:focus-visible' : {
112112 outline : 'none' ,
Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , { useState } from 'react' ;
22
3- import { Button } from 'storybook/internal/components' ;
3+ import { Button , Modal , PopoverProvider } from 'storybook/internal/components' ;
44
55import { CloseAltIcon } from '@storybook/icons' ;
66
7+ import { screen } from 'storybook/test' ;
78import { fn } from 'storybook/test' ;
89
910import preview from '../../../../../.storybook/preview' ;
@@ -146,3 +147,34 @@ export const WithoutColor = meta.story({
146147 color : 'none' ,
147148 } ,
148149} ) ;
150+
151+ const PopoverWithModal = ( ) => {
152+ const [ isOpen , setIsOpen ] = useState ( false ) ;
153+ return (
154+ < div >
155+ < Button ariaLabel = { false } onClick = { ( ) => setIsOpen ( true ) } >
156+ Open modal
157+ </ Button >
158+ < Modal open = { isOpen } onOpenChange = { setIsOpen } >
159+ < div > Hello</ div >
160+ </ Modal >
161+ </ div >
162+ ) ;
163+ } ;
164+
165+ export const WithModal = meta . story ( {
166+ render : ( ) => {
167+ const [ isPopoverOpen , setIsPopoverOpen ] = useState ( true ) ;
168+ return (
169+ < >
170+ < PopoverProvider visible = { isPopoverOpen } popover = { < PopoverWithModal /> } >
171+ < Button ariaLabel = { false } > Open popover</ Button >
172+ </ PopoverProvider >
173+ < div style = { { width : 100 , height : 100 , backgroundColor : 'thistle' } } > </ div >
174+ </ >
175+ ) ;
176+ } ,
177+ play : async ( { userEvent } ) => {
178+ await userEvent . click ( screen . getByRole ( 'button' , { name : 'Open modal' } ) ) ;
179+ } ,
180+ } ) ;
You can’t perform that action at this time.
0 commit comments