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 @@ -124,7 +124,12 @@ export const FormLayoutMixin = (superClass) =>
124
124
// Ensure there is a child text node in the style element
125
125
this . _styleElement . textContent = ' ' ;
126
126
127
- this . __intersectionObserver = new IntersectionObserver ( ( [ entry ] ) => {
127
+ this . __intersectionObserver = new IntersectionObserver ( ( entries ) => {
128
+ // If the browser is busy (e.g. due to slow rendering), multiple entries can
129
+ // be queued and then passed to the callback invocation at once. Make sure we
130
+ // use the most recent entry to detect whether the layout is visible or not.
131
+ // See https://github.com/vaadin/web-components/issues/8564
132
+ const entry = [ ...entries ] . pop ( ) ;
128
133
if ( ! entry . isIntersecting ) {
129
134
// Prevent possible jump when layout becomes visible
130
135
this . $ . layout . style . opacity = 0 ;
You can’t perform that action at this time.
0 commit comments