File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/components/d-fullscreen Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,15 @@ export const DFullScreen: React.FC<DFullScreenProps> = props => {
1717 if ( ! divRef . current ) return
1818
1919 window . addEventListener ( "resize" , ( ) => {
20- divRef . current ! ! . style . height = window . innerHeight + "px" ;
21- divRef . current ! ! . style . width = window . innerWidth + "px" ;
20+ const vw = Math . round ( window . visualViewport ?. width ?? window . innerWidth ) ;
21+ const vh = Math . round ( window . visualViewport ?. height ?? window . innerHeight ) ;
22+ divRef . current ! ! . style . height = vh + "px" ;
23+ divRef . current ! ! . style . width = vw + "px" ;
2224 } )
23- divRef . current ! ! . style . height = window . innerHeight + "px" ;
24- divRef . current ! ! . style . width = window . innerWidth + "px" ;
25+ const vw = Math . round ( window . visualViewport ?. width ?? window . innerWidth ) ;
26+ const vh = Math . round ( window . visualViewport ?. height ?? window . innerHeight ) ;
27+ divRef . current ! ! . style . height = vh + "px" ;
28+ divRef . current ! ! . style . width = vw + "px" ;
2529 } , [ divRef ] )
2630
2731 return < div { ...mergeCode0Props ( "d-full-screen" , props ) } ref = { divRef } >
You can’t perform that action at this time.
0 commit comments