-
Notifications
You must be signed in to change notification settings - Fork 208
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
fix(tooltip): fix infinite loop in self-managed tooltips #4269
Conversation
Tachometer resultsChromeaction-menu permalinktest-basic
test-directive permalink
test-lazy permalink
test-open-close-directive permalink
test-open-close permalink
picker permalinkbasic-test
split-button permalinkbasic-test
tooltip permalinktest-basic
test-directive permalink
test-element permalink
test-lazy permalink
truncated permalinkbasic-test
Firefoxaction-menu permalinktest-basic
test-directive permalink
test-lazy permalink
test-open-close-directive permalink
test-open-close permalink
picker permalinkbasic-test
split-button permalinkbasic-test
tooltip permalinktest-basic
test-directive permalink
test-element permalink
test-lazy permalink
truncated permalinkbasic-test
|
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.
Do we have tests that prove that if it finds document it doesn't bind listeners? A Tooltip in this situation should not work in any way, it should only dispatch the Dev Mode warning.
@Westbrook As it is right now it does bind event listeners on the document.
|
|
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.
Do we have tests that prove that if it finds document it doesn't bind listeners? A Tooltip in this situation should not work in any way, it should only dispatch the Dev Mode warning.
If not, we can land this on the presumption it works, as it seems to not be working for you otherwise.
…ttached to document
@Westbrook I added a unit test which fails before this change. Let me know if this would be enough in this scenario, or else I'm happy to implement other checks as well! |
); | ||
|
||
await elementUpdated(el); | ||
expect(documentEventsSpy.callCount).to.equal(0); |
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.
Can we confirm it doesn't attach to anything else, too?
expect(documentEventsSpy.callCount).to.equal(0); | |
expect(documentEventsSpy.callCount).to.equal(0); | |
expect(el.overlayElement?.triggerElement).to.be.null; |
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.
For Lighthouse/a preview URL, your branch name is too long. 🙈 We won't count it against you 😉
This is a good test, with that one extra expectation and a rebase to main
we should be good to go here. Thanks for finding tis issue!
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.
Thank you, thank you!
Description
Reordering some
if
statements to make sure a trigger is always returned for self-managed tooltips.Related issue(s)
Motivation and context
Fixes a bug which reproduces only when NOT in DEBUG mode. See details in the issue above.
Not sure how to add a unit test for this, since
triggerElement
is private and I can not check it from outside.How has this been tested?
self-managed
story and replacedsp-action-button
with adiv
document
self-managed
story and replacedsp-action-button
with adiv
document
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.