File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -330,11 +330,6 @@ async function waitForIcons(page: Page) {
330330 throw new Error ( 'Icon is not an SVGElement' ) ;
331331 }
332332
333- // If not visible, we don't care about loading state
334- if ( ! icon . checkVisibility ( ) ) {
335- return true ;
336- }
337-
338333 // If loaded, good it passes the test.
339334 if ( icon . dataset . loadingState === 'loaded' ) {
340335 return true ;
@@ -370,7 +365,12 @@ async function waitForIcons(page: Page) {
370365 const img = new Image ( ) ;
371366 img . src = url ;
372367 img . decode ( ) . then ( ( ) => {
373- icon . dataset . loadingState = 'loaded' ;
368+ // Wait two frames to let the time to the icon to repaint.
369+ requestAnimationFrame ( ( ) => {
370+ requestAnimationFrame ( ( ) => {
371+ icon . dataset . loadingState = 'loaded' ;
372+ } ) ;
373+ } ) ;
374374 } ) ;
375375
376376 return false ;
You can’t perform that action at this time.
0 commit comments