@salesforcedevs/dx-components 0.19.3-alpha.13 → 0.19.3-alpha.17
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
|
@@ -144,6 +144,7 @@ export default class SidebarSearch extends LightningElement {
|
|
|
144
144
|
// If this is the first render and there is a search value, trigger
|
|
145
145
|
// term highlighting
|
|
146
146
|
if (!this.didRender && this.value) {
|
|
147
|
+
console.log('dispatching highlight term in the render')
|
|
147
148
|
this.dispatchHighlightedTermChange();
|
|
148
149
|
}
|
|
149
150
|
|
|
@@ -14,6 +14,7 @@ export const highlightTerms = (
|
|
|
14
14
|
searchTerm = searchTerm.trim();
|
|
15
15
|
const searchExp = createSearchRegExp(searchTerm);
|
|
16
16
|
let scrolled = false;
|
|
17
|
+
console.log('highlighting called', elements)
|
|
17
18
|
elements.forEach((element) => {
|
|
18
19
|
if (
|
|
19
20
|
element?.innerHTML.includes("<dx-") ||
|
|
@@ -33,6 +34,7 @@ export const highlightTerms = (
|
|
|
33
34
|
innerHtml = innerHtml.replace(searchExp, "<mark>$&</mark>");
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
element.setAttribute('lwc:dom', 'manual')
|
|
36
38
|
element.innerHTML = innerHtml;
|
|
37
39
|
} catch (e) {
|
|
38
40
|
console.error(e, element);
|
|
@@ -42,8 +44,8 @@ export const highlightTerms = (
|
|
|
42
44
|
const mark = element.querySelector("mark");
|
|
43
45
|
if (mark && !scrolled) {
|
|
44
46
|
scrolled = true;
|
|
45
|
-
console.log("scrolling",
|
|
46
|
-
|
|
47
|
+
console.log("scrolling", mark);
|
|
48
|
+
mark.scrollIntoView({ block: "nearest" });
|
|
47
49
|
}
|
|
48
50
|
});
|
|
49
51
|
};
|