Closed johnwatkins0 closed 1 year ago
Project | @10up/component-library |
Status | Passed |
Commit | 8c347f9dec ℹ️ |
Started | Sep 20, 2022 2:38 PM |
Ended | Sep 20, 2022 2:39 PM |
Duration | 00:43 💡 |
OS | Linux Ubuntu - 20.04 |
Browser | Chrome 105 ![]() |
View run in Cypress Dashboard ➡️
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard
Description of the Change
Fixes #120 by using the
forEach
index instead ofthis.count
to generate a unique ID for tooltips.Alternate Designs
Incrementing
this.count
in place like below also worked in local testing, but I think theforEach
index is more reliable.Benefits
Possible Drawbacks
This is a quick fix for my current project, but there will still be duplicate tooltip IDs on the page if the
Tooltip
class is instantiated multiple times on the page with different selectors.The unique IDs should be generated using the uuid package, or the Tooltip class should allow passing in an ID prefix. Or the number of Tooltip instances could be tracked in the global scope.
Verification Process
Checklist:
Applicable Issues
120