File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,33 @@ const InitialFocusTemplate: StoryFn<ModalProps> = (args) => {
225225 ) ;
226226} ;
227227
228+ const LongContentTemplate : StoryFn < ModalProps > = ( args ) => {
229+ const [ open , setOpen ] = React . useState ( false ) ;
230+ const handleClose = ( ) => setOpen ( false ) ;
231+ return (
232+ < div >
233+ < Button onClick = { ( ) => setOpen ( true ) } > Open modal</ Button >
234+ < Modal { ...args } open = { open } onClose = { handleClose } >
235+ < Modal . Header > Modal with Long Content</ Modal . Header >
236+ < Modal . Body >
237+ < div >
238+ { [ ...Array ( 30 ) ] . map ( ( _ , i ) => (
239+ < p key = { i } >
240+ Lorem ipsum dolor sit amet, consectetur adipiscing elit.
241+ Pellentesque euismod, nisi vel consectetur euismod, nisl nisi
242+ consectetur nisi, euismod euismod nisi nisi euismod.
243+ </ p >
244+ ) ) }
245+ </ div >
246+ </ Modal . Body >
247+ < Modal . Footer alignment = "end" >
248+ < Button onClick = { handleClose } > Close</ Button >
249+ </ Modal . Footer >
250+ </ Modal >
251+ </ div >
252+ ) ;
253+ } ;
254+
228255export const Default : Story = {
229256 render : DefaultTemplate ,
230257} ;
@@ -257,6 +284,22 @@ export const WithoutCloseButton: Story = {
257284 } ,
258285} ;
259286
287+ export const WithLongContent : Story = {
288+ render : LongContentTemplate ,
289+ args : {
290+ size : "medium" ,
291+ variant : "default" ,
292+ } ,
293+ parameters : {
294+ docs : {
295+ description : {
296+ story :
297+ "This story demonstrates the Modal component with enough content to trigger a vertical scrollbar." ,
298+ } ,
299+ } ,
300+ } ,
301+ } ;
302+
260303export const LeftAlignedBody : Story = {
261304 render : DefaultTemplate ,
262305 args : {
You can’t perform that action at this time.
0 commit comments