Feature request: add id attribute on heading block DOM elements
#2846
Ovgodd
started this conversation in
Ideas & Enhancements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature Request
Hello, I'm opening a feature request about heading block accessibility in BlockNote. This came up during an accessibility audit of Docs (La Suite).
Is your feature request related to a problem or unsupported use case? Please describe.
Our accessibility audit requires that table of contents entries be
<a href="#heading-id">links pointing to the corresponding headings in the document. Activating an entry must move focus to the target heading, whether the user is in reading or editing mode.We've changed TOC entries from
<button>to<a>on our side, but we cannot fully implement the focus requirement because BlockNote heading blocks don't carry anidattribute in the DOM. We tried settingidmanually via DOM manipulation, but don't want any side effectsCurrent DOM output
No id on the heading element, anchor links have no target, and focus() has nothing to target.
Describe the solution you'd like
Each heading block should render with a stable id attribute, e.g.:
Introduction
This would allow:
<a href="#heading-abc123">links to target headingsProgrammatic focus() on headings for keyboard accessibility
Native browser fragment navigation as a fallback
Beta Was this translation helpful? Give feedback.
All reactions