Skip to content

Commit

Permalink
Checks for existing scrollTarget before overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers authored Apr 23, 2018
1 parent e62995a commit 65ea99c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app-header-layout/app-header-layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@
// the content until the height of the header can be read.
this.$.wrapper.classList.remove('initializing');
// Update scroll target.
header.scrollTarget = this.hasScrollingRegion ?
this.$.contentContainer :
this.ownerDocument.documentElement;
header.scrollTarget =
!header.scrollTarget === header._defaultScrollTarget ? header.scrollTarget
: this.hasScrollingRegion ? this.$.contentContainer
: this.ownerDocument.documentElement;
// Get header height here so that style reads are batched together before
// style writes (i.e. getBoundingClientRect() below).
var headerHeight = header.offsetHeight;
Expand Down

0 comments on commit 65ea99c

Please sign in to comment.