File tree Expand file tree Collapse file tree 1 file changed +28
-4
lines changed
packages/runtime-dom/src/components Expand file tree Collapse file tree 1 file changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -378,11 +378,35 @@ function whenTransitionEnds(
378378 end ( )
379379 }
380380 }
381- setTimeout ( ( ) => {
382- if ( ended < propCount ) {
383- end ( )
381+ // setTimeout(() => {
382+ // if (ended < propCount) {
383+ // end()
384+ // }
385+ // }, timeout + 1)
386+
387+ const fallbackTimeout = ( ) => {
388+ let loopStart : number | null = null
389+ const loop = ( timeStamp : number ) => {
390+ if ( ! loopStart ) {
391+ loopStart = timeStamp
392+ }
393+
394+ const elapsed = timeStamp - loopStart
395+ if ( elapsed >= timeout + 1 ) {
396+ if ( ended < propCount ) {
397+ end ( )
398+ return
399+ }
400+ }
401+
402+ requestAnimationFrame ( loop )
384403 }
385- } , timeout + 1 )
404+
405+ requestAnimationFrame ( loop )
406+ }
407+
408+ fallbackTimeout ( )
409+
386410 el . addEventListener ( endEvent , onEnd )
387411}
388412
You can’t perform that action at this time.
0 commit comments