File tree Expand file tree Collapse file tree
packages/fxa-settings/src/components/Settings/Modal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const ModalToggle = ({ children }: ModalToggleProps) => {
2222 const [ modalRevealed , showModal , hideModal ] = useBooleanState ( true ) ;
2323 const onClick = useCallback (
2424 ( ev : React . MouseEvent ) => {
25- ev . preventDefault ( ) ;
25+ ev . stopPropagation ( ) ;
2626 showModal ( ) ;
2727 } ,
2828 [ showModal ]
@@ -85,6 +85,26 @@ export const WithConfirmButton = () => (
8585 </ ModalToggle >
8686) ;
8787
88+ export const WithLongContent = ( ) => (
89+ < ModalToggle >
90+ { ( { modalRevealed, hideModal } ) =>
91+ modalRevealed && (
92+ < Modal
93+ headerId = "some-id"
94+ descId = "some-description"
95+ onConfirm = { hideModal as ( ) => void }
96+ onDismiss = { hideModal }
97+ >
98+ < h2 > This is a modal with long content.</ h2 >
99+ { Array . from ( { length : 42 } , ( _ , i ) => (
100+ < p key = { i } > Scroll down to see more</ p >
101+ ) ) }
102+ </ Modal >
103+ )
104+ }
105+ </ ModalToggle >
106+ ) ;
107+
88108export const WithConfirmAndNoCancelButton = ( ) => (
89109 < ModalToggle >
90110 { ( { modalRevealed, hideModal } ) =>
Original file line number Diff line number Diff line change @@ -61,12 +61,12 @@ export const Modal = ({
6161 < Portal id = "modal" >
6262 < div
6363 data-testid = { testid }
64- className = "flex flex-col justify-center fixed inset-0 z-50 w-full p-2 h-full bg-black/75"
64+ className = "flex fixed inset-0 z-50 w-full p-2 bg-black/75 h-dvh overflow-y-auto overscroll-contain "
6565 >
6666 < div
6767 data-testid = "modal-content-container"
6868 className = { classNames (
69- 'max-w-120 bg-white mx -auto rounded-xl border border-transparent overflow-y-auto ' ,
69+ 'max-w-120 bg-white m -auto rounded-xl border border-transparent' ,
7070 className
7171 ) }
7272 ref = { modalInsideRef }
You can’t perform that action at this time.
0 commit comments