File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk.Razor" >
22
33 <PropertyGroup >
4- <Version >9.0.0-beta03 </Version >
4+ <Version >9.0.1-beta02 </Version >
55 </PropertyGroup >
66
77 <ItemGroup >
Original file line number Diff line number Diff line change @@ -121,15 +121,27 @@ export function init(id) {
121121 }
122122
123123 if ( el . classList . contains ( 'is-draggable-center' ) ) {
124- const width = el . offsetWidth / 2 ;
125- const height = el . offsetHeight / 2 ;
126-
127- el . style . setProperty ( "margin-left" , `calc(50vw - ${ width } px)` ) ;
128- el . style . setProperty ( "margin-top" , `calc(50vh - ${ height } px)` ) ;
129- el . classList . remove ( 'is-draggable-center' ) ;
124+ const check = ( ) => {
125+ if ( el . offsetWidth > 0 ) {
126+ update ( el ) ;
127+ }
128+ else {
129+ requestAnimationFrame ( check ) ;
130+ }
131+ }
132+ requestAnimationFrame ( check ) ;
130133 }
131134}
132135
136+ const update = el => {
137+ const width = el . offsetWidth / 2 ;
138+ const height = el . offsetHeight / 2 ;
139+
140+ el . style . setProperty ( "margin-left" , `calc(50vw - ${ width } px)` ) ;
141+ el . style . setProperty ( "margin-top" , `calc(50vh - ${ height } px)` ) ;
142+ el . classList . remove ( 'is-draggable-center' ) ;
143+ }
144+
133145export function dispose ( id ) {
134146 const dialog = Data . get ( id )
135147 Data . remove ( id )
You can’t perform that action at this time.
0 commit comments