File tree 1 file changed +6
-1
lines changed
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))
272
272
constructor ( ) {
273
273
super ( ) ;
274
274
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 ( ) ;
276
281
if ( ! entry . isIntersecting ) {
277
282
// Prevent possible jump when layout becomes visible
278
283
this . $ . layout . style . opacity = 0 ;
You can’t perform that action at this time.
0 commit comments