@salesforcedevs/dx-components 0.56.2-seo-test1 → 0.56.2-seo-dx-test3

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/dx-components",
3
- "version": "0.56.2-seo-test1",
3
+ "version": "0.56.2-seo-dx-test3",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -307,12 +307,24 @@ export default class SidebarSearch extends LightningElement {
307
307
  }
308
308
 
309
309
  let href;
310
- if (queryParam) {
310
+ let isSelected = false;
311
+ const isReferenceUrl = clickUri.includes("/references/");
312
+ if (isReferenceUrl) {
311
313
  href = `${pathname}${queryParam}&q=${this.value}`;
314
+
315
+ //NOTE: This is specific to references related comparison
316
+ const resultHrefWithMetaQuery = `${pathname}${queryParam}`;
317
+
318
+ const urlParams = new URLSearchParams(window.location.search);
319
+ const metaQueryParam = urlParams.get("meta");
320
+ const currentUrlPathWithQuery = `${window.location.pathname}?meta=${metaQueryParam}`;
321
+
322
+ isSelected = resultHrefWithMetaQuery === currentUrlPathWithQuery;
312
323
  } else {
313
324
  href = `${pathname}?q=${this.value}`;
325
+ isSelected = pathname === window.location.pathname;
314
326
  }
315
- const currentUrlHrefWithQuery = `${window.location.pathname}${window.location.search}`;
327
+
316
328
  return {
317
329
  title,
318
330
  titleHighlights,
@@ -320,7 +332,7 @@ export default class SidebarSearch extends LightningElement {
320
332
  excerptHighlights,
321
333
  uniqueId,
322
334
  href,
323
- selected: href.startsWith(currentUrlHrefWithQuery)
335
+ selected: isSelected
324
336
  };
325
337
  };
326
338