File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
packages/react-aria-components/stories Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ export const ModalExample = () => (
62
62
) ;
63
63
64
64
export const ModalInteractionOutsideExample = ( ) => {
65
-
65
+
66
66
useEffect ( ( ) => {
67
67
let button = document . createElement ( 'button' ) ;
68
68
button . id = 'test-button' ;
@@ -72,8 +72,12 @@ export const ModalInteractionOutsideExample = () => {
72
72
button . style . right = '0' ;
73
73
button . style . zIndex = '200' ;
74
74
document . body . appendChild ( button ) ;
75
+
76
+ return ( ) => {
77
+ document . body . removeChild ( button ) ;
78
+ } ;
75
79
} , [ ] ) ;
76
-
80
+
77
81
return (
78
82
< DialogTrigger >
79
83
< Button > Open modal</ Button >
@@ -125,7 +129,7 @@ export const ModalInteractionOutsideExample = () => {
125
129
} ;
126
130
127
131
export const ModalInteractionOutsideDefaultOverlayExample = ( ) => {
128
-
132
+
129
133
useEffect ( ( ) => {
130
134
let button = document . createElement ( 'button' ) ;
131
135
button . id = 'test-button' ;
@@ -135,8 +139,11 @@ export const ModalInteractionOutsideDefaultOverlayExample = () => {
135
139
button . style . right = '0' ;
136
140
button . style . zIndex = '200' ;
137
141
document . body . appendChild ( button ) ;
142
+ return ( ) => {
143
+ document . body . removeChild ( button ) ;
144
+ } ;
138
145
} , [ ] ) ;
139
-
146
+
140
147
return (
141
148
< DialogTrigger >
142
149
< Button > Open modal</ Button >
You can’t perform that action at this time.
0 commit comments