@salesforcedevs/dx-components 1.3.104-alpha03 → 1.3.104-alpha04

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": "1.3.104-alpha03",
3
+ "version": "1.3.104-alpha04",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -155,6 +155,17 @@ export default class SearchResults extends LightningElement {
155
155
  Coveo.$$(root).on(
156
156
  Coveo.InitializationEvents.afterInitialization,
157
157
  () => {
158
+ const url = new URL(window.location.href);
159
+ const searchParams = url.searchParams;
160
+ const keywordsParam = searchParams.get("keywords");
161
+
162
+ // Accomodate for the global nav using 'keywords' param instead of 'q'
163
+ if (keywordsParam) {
164
+ this._query = searchParams.get("keywords")!;
165
+ searchParams.delete("keywords");
166
+ window.history.replaceState(null, "", url.href);
167
+ }
168
+
158
169
  if (this._query !== "") {
159
170
  Coveo.state(this.root!, "q", this.searchQuery);
160
171
  }