@salesforcedevs/docs-components 1.34.4-scroll-1 → 1.34.4-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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.34.4-scroll-1",
3
+ "version": "1.34.4-scroll-2",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -501,12 +501,12 @@ export default class ContentLayout extends LightningElement {
501
501
  }
502
502
 
503
503
  /**
504
- * Attempts the one-shot hash scroll and marks it complete only if scrolling succeeds,
505
- * keeping both trigger points consistent.
506
- */
504
+ * Completes the one-shot if no hash exists or scrolling succeeds,
505
+ * retrying only when the target isn't available yet to prevent
506
+ * unexpected scrolls on observer re-attach. */
507
507
  // eslint-disable-next-line no-undef
508
508
  protected tryScrollToHash(headingElements: NodeListOf<Element>): void {
509
- if (this.scrollToHash(headingElements)) {
509
+ if (!window.location.hash || this.scrollToHash(headingElements)) {
510
510
  this.didScrollToSelectedHash = true;
511
511
  }
512
512
  }