@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
|
@@ -307,12 +307,24 @@ export default class SidebarSearch extends LightningElement {
|
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
let href;
|
|
310
|
-
|
|
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
|
-
|
|
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:
|
|
335
|
+
selected: isSelected
|
|
324
336
|
};
|
|
325
337
|
};
|
|
326
338
|
|