@salesforcedevs/docs-components 1.34.5-scroll-1 → 1.34.5-scroll-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -517,25 +517,25 @@ export default class ContentLayout extends LightningElement {
|
|
|
517
517
|
this.didScrollToSelectedHash = true;
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
)
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
() => this.tryScrollToHash(this.getHeadingElements()),
|
|
529
|
-
HASH_SCROLL_DELAY
|
|
530
|
-
);
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
if (this.scrollToHash(headingElements)) {
|
|
520
|
+
this.hashScrollWaitStart ??= Date.now();
|
|
521
|
+
const waitExpired =
|
|
522
|
+
Date.now() - this.hashScrollWaitStart >= MAX_HASH_SCROLL_WAIT_TIME;
|
|
523
|
+
const scrolled =
|
|
524
|
+
(waitExpired || !this.hasPendingCodeBlocks()) &&
|
|
525
|
+
this.scrollToHash(headingElements);
|
|
526
|
+
|
|
527
|
+
if (scrolled || waitExpired) {
|
|
535
528
|
this.didScrollToSelectedHash = true;
|
|
536
529
|
this.hashScrollWaitStart = undefined;
|
|
537
530
|
clearTimeout(this.hashScrollTimerId);
|
|
531
|
+
return;
|
|
538
532
|
}
|
|
533
|
+
|
|
534
|
+
clearTimeout(this.hashScrollTimerId);
|
|
535
|
+
this.hashScrollTimerId = setTimeout(
|
|
536
|
+
() => this.tryScrollToHash(this.getHeadingElements()),
|
|
537
|
+
HASH_SCROLL_DELAY
|
|
538
|
+
);
|
|
539
539
|
}
|
|
540
540
|
|
|
541
541
|
protected hasPendingCodeBlocks(): boolean {
|