@salesforcedevs/docs-components 1.3.9-h2-toc-fix-2 → 1.3.9-h2-toc-fix-4
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
|
@@ -192,9 +192,9 @@ export default class ContentLayout extends LightningElement {
|
|
|
192
192
|
this.observer = new IntersectionObserver((entries) => {
|
|
193
193
|
entries.forEach(
|
|
194
194
|
(entry) =>
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
(this.anchoredElements[
|
|
196
|
+
entry.target.getAttribute("id")
|
|
197
|
+
].intersect = entry.isIntersecting)
|
|
198
198
|
);
|
|
199
199
|
this.calculateActualSection();
|
|
200
200
|
});
|
|
@@ -244,7 +244,8 @@ export default class ContentLayout extends LightningElement {
|
|
|
244
244
|
headingElement.id = headingElement.hash;
|
|
245
245
|
|
|
246
246
|
// Update tocOptions from anchorTags only for H2
|
|
247
|
-
const
|
|
247
|
+
const headingAriaLevel = headingElement.attributes["aria-level"]?.nodeValue || "2"
|
|
248
|
+
const isH2 = headingAriaLevel === "2";
|
|
248
249
|
|
|
249
250
|
if (isH2) {
|
|
250
251
|
const tocItem = {
|