@salesforcedevs/docs-components 1.3.342 → 1.3.344

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.3.342",
3
+ "version": "1.3.344",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -24,5 +24,5 @@
24
24
  "@types/lodash.orderby": "4.6.9",
25
25
  "@types/lodash.uniqby": "4.7.9"
26
26
  },
27
- "gitHead": "b22e5b8720d2780240cdba99bd3942ec32f58356"
27
+ "gitHead": "189d356c6cb2b3cca66b7728a288036c6850421a"
28
28
  }
@@ -198,6 +198,13 @@ export default class ContentLayout extends LightningElement {
198
198
  );
199
199
  }
200
200
 
201
+ // This event gets triggered when navigating back/forward
202
+ handlePopState = (): void => {
203
+ if (this.showTabBasedRNB) {
204
+ this.restoreTabSelection();
205
+ }
206
+ };
207
+
201
208
  connectedCallback(): void {
202
209
  const hasParentHighlightListener = closest(
203
210
  "doc-xml-content",
@@ -210,6 +217,7 @@ export default class ContentLayout extends LightningElement {
210
217
  );
211
218
  this.searchSyncer.init();
212
219
  }
220
+ window.addEventListener("popstate", this.handlePopState);
213
221
  }
214
222
 
215
223
  private getSelectedTabId() {
@@ -285,6 +293,7 @@ export default class ContentLayout extends LightningElement {
285
293
  window.removeEventListener("scroll", this.adjustNavPosition);
286
294
  window.removeEventListener("resize", this.adjustNavPosition);
287
295
  window.removeEventListener("tabchanged", this.onTabChanged);
296
+ window.removeEventListener("popstate", this.handlePopState);
288
297
  this.searchSyncer.dispose();
289
298
  this.clearRenderObserverTimer();
290
299
 
@@ -446,6 +455,9 @@ export default class ContentLayout extends LightningElement {
446
455
  };
447
456
  this.observer.observe(headingElement);
448
457
  }
458
+
459
+ this.contentLoaded = true;
460
+
449
461
  if (!this.didScrollToSelectedHash) {
450
462
  this.didScrollToSelectedHash = true;
451
463
  this.scrollToHash(headingElements);