-
Notifications
You must be signed in to change notification settings - Fork 126
Make ToolTipElement
for
an observed attribute
#3558
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
Make ToolTipElement
for
an observed attribute
#3558
Conversation
🦋 Changeset detectedLatest commit: 9b55c8c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR makes the ToolTipElement support a new observed attribute "for" to improve interop with other frontend frameworks. Key changes include:
- Adding "for" to the list of observed attributes.
- Extracting the event listener and attribute update logic into a new method (#updateControl).
- Adjusting attributeChangedCallback to call #updateControl when the "for" attribute changes.
Comments suppressed due to low confidence (1)
app/components/primer/alpha/tool_tip.ts:303
- Confirm that updating the 'for' attribute triggers the correct re-association with the new control, and that any necessary cleanup or re-initialization is performed to avoid side effects.
if (name === 'for') {
@myabc thanks for the contribution! can you add a changeset? You can do so running |
ac0ad80
to
9cdb9d2
Compare
Enables the for attribute (and associated control element) to be dynamically added or updated after the custom element is connected to the DOM, allowing event listeners to be attached accordingly. This improves compatibility with frontend frameworks that bind attributes post-instantiation, enhancing interop in dynamic or reactive rendering scenarios. Closes primer#3557
9cdb9d2
to
9b55c8c
Compare
Hi @francinelucca Many thanks for looking at this PR! I've added the changeset - and will also update the description. |
What are you trying to accomplish?
Make
ToolTipElement
for
an observed attribute.Enables the for attribute (and associated control element) to be dynamically added or updated after the custom element is connected to the DOM, allowing event listeners to be attached accordingly.
This improves compatibility with frontend frameworks (e.g. Angular) that bind attributes post-instantiation.
Integration
This change should not require any changes to production code.
List the issues that this change affects.
Closes #3557
Risk Assessment
What approach did you choose and why?
N/A
Anything you want to highlight for special attention from reviewers?
Tested with a recent version of Angular: opf/openproject#19121
Merge checklist