-
-
Notifications
You must be signed in to change notification settings - Fork 341
feat(core): add dom attributes option for nodes #1861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): add dom attributes option for nodes #1861
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
@cmath10 is attempting to deploy a commit to the Burak Cakmakoglu's projects Team on Vercel. A member of the Team first needs to authorize it. |
Thanks for the PR - I'll have a look although I can't promise it lands since VueFlow 1.x is technically in a feature freeze so I usually only accept bugfix PRs atm :/ (I should add a warning for this to the repo, my bad ^^) Although this looks like a rather small change so this might be fine, but again no promises, sorry. Customizing a11y attributes will be possible in 2.x though which should be released some time this year so whether this lands or not you will get the ability to customize them to your liking at some point either way. |
I will consider adding this feature to VueFlow 1.x Will report back here once I finally decided to move forward with this or not ^^ |
I will be adding this with a couple changes though:
|
Signed-off-by: braks <[email protected]>
Signed-off-by: braks <[email protected]>
* feat(core): add dom attributes option for nodes and edges (#1861) Signed-off-by: braks <[email protected]> * chore(changeset): add * chore: cleanup Signed-off-by: braks <[email protected]> --------- Signed-off-by: braks <[email protected]> Co-authored-by: Kirill Zaytsev <[email protected]>
feat: Possibility to customize nodes HTML attributes
* feat(core): add dom attributes option for nodes and edges (#1861) Signed-off-by: braks <[email protected]> * chore(changeset): add * chore: cleanup Signed-off-by: braks <[email protected]> --------- Signed-off-by: braks <[email protected]> Co-authored-by: Kirill Zaytsev <[email protected]>
This is released in |
🚀 What's changed?
Added the possibility to customize HTML attributes of
.vue-flow__node
elements, globally through the nodesAttributes prop, and for each single node.🐛 Fixes
None
🪴 To-Dos
None
Motivation
For my use case, I need greater flexibility in customizing ARIA attributes — for example, being able to explicitly set a
role
or provide additionalaria-*
properties.Currently,
role="button"
is set automatically when focusable is true and omitted otherwise, with no way to override this behavior. Whilearia-label
can be configured, this alone is often not sufficient for proper accessibility. Other attributes, such as aria-describedby, are managed internally and cannot be customized externally, which limits the ability to implement more advanced accessibility patterns.According to WAI-ARIA specifications, for example, aria-describedby may include multiple ID references — something that is currently not supported via the API.
This PR is intended as a starting point for discussion, and I’m open to feedback on how to make this more flexible while fitting within the existing design.