Skip to content

Commit

Permalink
fix(header): header opacity properly resets on collapsible titles (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi committed Jan 14, 2020
1 parent 9d63b41 commit 8e11f79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/**
Expand Down

0 comments on commit 8e11f79

Please sign in to comment.