Skip to content

Fix/7579 toc scroll console error#12433

Merged
kodiakhq[bot] merged 28 commits intocarbon-design-system:mainfrom
bruno-amorim:fix/7579-toc-scroll-console-error
Mar 3, 2026
Merged

Fix/7579 toc scroll console error#12433
kodiakhq[bot] merged 28 commits intocarbon-design-system:mainfrom
bruno-amorim:fix/7579-toc-scroll-console-error

Conversation

@bruno-amorim
Copy link
Contributor

Related Ticket(s)

https://jsw.ibm.com/browse/ADCMS-8128

Description

The calculation that the ToC component does to map all the sections of the page and link them to the ToC's buttons was also being called on pages without the ToC enabled. That was causing the property 'position' to be undefined due to ToC trying to compute multiple items but only finding one, resulting in multiple of these errors in the console:

image

Changelog

  • packages/web-components/src/components/table-of-contents/table-of-contents.ts

added some conditions to validate if there are enough elements to trigger the calculations.

…-dotcom into fix/7579-toc-scroll-console-error
@bruno-amorim bruno-amorim requested a review from a team as a code owner March 3, 2026 14:30
@bruno-amorim bruno-amorim removed the request for review from a team March 3, 2026 14:31
@netlify
Copy link

netlify bot commented Mar 3, 2026

Deploy Preview for incomparable-wisp-8d6771 ready!

Name Link
🔨 Latest commit b563255
🔍 Latest deploy log https://app.netlify.com/projects/incomparable-wisp-8d6771/deploys/69a6f0a672a5410008926cdd
😎 Deploy Preview https://deploy-preview-12433--incomparable-wisp-8d6771.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Mar 3, 2026

Deploy Preview for ibm-dotcom-web-components ready!

Name Link
🔨 Latest commit b563255
🔍 Latest deploy log https://app.netlify.com/projects/ibm-dotcom-web-components/deploys/69a6f0a6ec97440008ce4960
😎 Deploy Preview https://deploy-preview-12433--ibm-dotcom-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@marcelojcs marcelojcs added the Ready to merge Label for the pull requests that are ready to merge label Mar 3, 2026
@kodiakhq kodiakhq bot merged commit 8d211be into carbon-design-system:main Mar 3, 2026
16 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge Label for the pull requests that are ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants