File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/react-aria-components/src Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -184,17 +184,22 @@ function ModalOverlayInner({UNSTABLE_portalContainer, ...props}: ModalOverlayInn
184184 } ) ;
185185
186186 let viewport = useViewportSize ( ) ;
187+ let pageWidth : number | undefined = undefined ;
187188 let pageHeight : number | undefined = undefined ;
188189 if ( typeof document !== 'undefined' ) {
189190 let scrollingElement = isScrollable ( document . body ) ? document . body : document . scrollingElement || document . documentElement ;
190- // Prevent Firefox from adding scrollbars when the page has a fractional height.
191+ // Prevent Firefox from adding scrollbars when the page has a fractional width/height.
192+ let fractionalWidthDifference = scrollingElement . getBoundingClientRect ( ) . width % 1 ;
191193 let fractionalHeightDifference = scrollingElement . getBoundingClientRect ( ) . height % 1 ;
194+ pageWidth = scrollingElement . scrollWidth - fractionalWidthDifference ;
192195 pageHeight = scrollingElement . scrollHeight - fractionalHeightDifference ;
193196 }
194197
195198 let style = {
196199 ...renderProps . style ,
200+ '--visual-viewport-width' : viewport . width + 'px' ,
197201 '--visual-viewport-height' : viewport . height + 'px' ,
202+ '--page-width' : pageWidth !== undefined ? pageWidth + 'px' : undefined ,
198203 '--page-height' : pageHeight !== undefined ? pageHeight + 'px' : undefined
199204 } ;
200205
You can’t perform that action at this time.
0 commit comments