fix(header): header opacity properly resets on collapsible titles (#20202)

This commit is contained in:
Liam DeBeasi
2020-01-14 11:40:35 -05:00
committed by GitHub
parent 9d63b41a52
commit 8e11f79fcc

View File

@ -116,7 +116,9 @@ export class Header implements ComponentInterface {
* border as the top-most toolbar collapses or expands.
*/
const toolbarIntersection = (ev: any) => { handleToolbarIntersection(ev, mainHeaderIndex, scrollHeaderIndex); };
this.intersectionObserver = new IntersectionObserver(toolbarIntersection, { threshold: [0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], rootMargin: `-${mainHeaderHeight}px 0px 0px 0px` });
// Subtracting 1 pixel gives us some wiggle room for ensuring everything is reset in different edge cases
this.intersectionObserver = new IntersectionObserver(toolbarIntersection, { threshold: [0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], rootMargin: `-${mainHeaderHeight - 1}px 0px 0px 0px` });
this.intersectionObserver.observe(scrollHeaderIndex.toolbars[scrollHeaderIndex.toolbars.length - 1].el);
/**