@salesforcedevs/dx-components 1.32.0-alpha.4 → 1.32.0-alpha.6
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.32.0-alpha.
|
|
3
|
+
"version": "1.32.0-alpha.6",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"luxon": "3.4.4",
|
|
45
45
|
"msw": "^2.12.4"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "5016c91d92b1118478cc3b9d549541563fca3801"
|
|
48
48
|
}
|
|
@@ -161,6 +161,13 @@ export default class Sidebar extends SidebarBase {
|
|
|
161
161
|
|
|
162
162
|
private onSearchChange(e: CustomEvent) {
|
|
163
163
|
this.requestedFetchMoreResults = false;
|
|
164
|
+
const isFirstSearchHydration = this.searchValue === null;
|
|
165
|
+
const hasSelectedResult = (e.detail.results || []).some(
|
|
166
|
+
(result: SidebarSearchResult) => !!result.selected
|
|
167
|
+
);
|
|
168
|
+
if (isFirstSearchHydration && hasSelectedResult) {
|
|
169
|
+
this.scrollToSelectedSearchResult = true;
|
|
170
|
+
}
|
|
164
171
|
this.searchResults = e.detail.results;
|
|
165
172
|
this.searchValue = e.detail.value;
|
|
166
173
|
}
|
|
@@ -204,18 +211,23 @@ export default class Sidebar extends SidebarBase {
|
|
|
204
211
|
const searchContent = this.template.querySelector(
|
|
205
212
|
".sidebar-content-search"
|
|
206
213
|
) as HTMLElement | null;
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
214
|
+
const allResultItems = searchContent?.querySelectorAll(
|
|
215
|
+
"dx-sidebar-search-result"
|
|
216
|
+
);
|
|
217
|
+
const selectedResult =
|
|
218
|
+
(allResultItems?.[selectedSearchResultIndex] as HTMLElement) ||
|
|
219
|
+
null;
|
|
212
220
|
if (!searchContent || !selectedResult) {
|
|
213
221
|
return;
|
|
214
222
|
}
|
|
215
223
|
|
|
216
|
-
|
|
217
|
-
selectedResult.
|
|
218
|
-
|
|
224
|
+
window.requestAnimationFrame(() => {
|
|
225
|
+
selectedResult.scrollIntoView({
|
|
226
|
+
block: "start",
|
|
227
|
+
inline: "nearest"
|
|
228
|
+
});
|
|
229
|
+
this.scrollToSelectedSearchResult = false;
|
|
230
|
+
});
|
|
219
231
|
}
|
|
220
232
|
|
|
221
233
|
private assignValueToLabel(node: TreeNode): void {
|