@salesforcedevs/docs-components 1.3.327-rnbtab-alpha1 → 1.3.327-rnbtab-alpha3

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.327-rnbtab-alpha1",
3
+ "version": "1.3.327-rnbtab-alpha3",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -210,10 +210,6 @@ export default class ContentLayout extends LightningElement {
210
210
  );
211
211
  this.searchSyncer.init();
212
212
  }
213
-
214
- if (this.showTabBasedRNB) {
215
- window.addEventListener("tabchanged", this.onTabChanged);
216
- }
217
213
  }
218
214
 
219
215
  private getSelectedTabId() {
@@ -223,10 +219,12 @@ export default class ContentLayout extends LightningElement {
223
219
  }
224
220
 
225
221
  private restoreTabSelection() {
226
- const selectedTabId = this.getSelectedTabId();
227
- if (selectedTabId) {
228
- this.selectTabById(selectedTabId);
229
- }
222
+ requestAnimationFrame(() => {
223
+ const selectedTabId = this.getSelectedTabId();
224
+ if (selectedTabId) {
225
+ this.selectTabById(selectedTabId);
226
+ }
227
+ });
230
228
  }
231
229
 
232
230
  private getAllTabs(): any[] {
@@ -271,6 +269,7 @@ export default class ContentLayout extends LightningElement {
271
269
  this.hasRendered = true;
272
270
  this.setRNBByTab();
273
271
  if (this.showTabBasedRNB) {
272
+ window.addEventListener("tabchanged", this.onTabChanged);
274
273
  this.restoreTabSelection();
275
274
  }
276
275
  this.restoreScroll();