Skip to content

Commit 7ab7b28

Browse files
cci: normalize heading before +overlay
Heading is not normalized before "Start working on section" overlay is added, causing a bit of spillover into the next section. Minor visual bug, but annoying nonetheless.
1 parent df82208 commit 7ab7b28

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/session/DeputyRootSession.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,15 +508,17 @@ export default class DeputyRootSession {
508508
* @param heading
509509
*/
510510
addSectionOverlay( casePage: DeputyCasePage, heading: ContributionSurveyHeading ): void {
511-
const section = casePage.getContributionSurveySection( heading );
511+
const normalizedHeading = casePage.normalizeSectionHeading( heading );
512+
const section = casePage.getContributionSurveySection( normalizedHeading );
512513
const list = section.find(
513514
( v ) => v instanceof HTMLElement && v.tagName === 'UL'
514515
) as HTMLUListElement;
515516

516-
const headingTop = window.scrollY + heading.getBoundingClientRect().bottom;
517+
const headingTop = window.scrollY +
518+
normalizedHeading.getBoundingClientRect().bottom;
517519
const sectionBottom = window.scrollY + (
518520
findNextSiblingElement( last( section ) )?.getBoundingClientRect()?.top ??
519-
heading.parentElement.getBoundingClientRect().bottom
521+
normalizedHeading.parentElement.getBoundingClientRect().bottom
520522
);
521523
const overlayHeight = sectionBottom - headingTop;
522524
if ( list != null ) {

0 commit comments

Comments
 (0)