File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,12 @@ class FormLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))
272272 constructor ( ) {
273273 super ( ) ;
274274
275- this . __intersectionObserver = new IntersectionObserver ( ( [ entry ] ) => {
275+ this . __intersectionObserver = new IntersectionObserver ( ( entries ) => {
276+ // If the browser is busy (e.g. due to slow rendering), multiple entries can
277+ // be queued and then passed to the callback invocation at once. Make sure we
278+ // use the most recent entry to detect whether the layout is visible or not.
279+ // See https://github.com/vaadin/web-components/issues/8564
280+ const entry = [ ...entries ] . pop ( ) ;
276281 if ( ! entry . isIntersecting ) {
277282 // Prevent possible jump when layout becomes visible
278283 this . $ . layout . style . opacity = 0 ;
You can’t perform that action at this time.
0 commit comments