-
Notifications
You must be signed in to change notification settings - Fork 12
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
Prevent default/stop propagation on Tooltip.disclosure click #1476
Conversation
64301f9
to
ba7766b
Compare
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.
Code looks good!
Could you please finish filling out the checklist, though? thanks!
I think all the remaining checkboxes can be checked at this point. elm-explorations unfortunately does not emulates even bubbling. It's impossible to elm-test the actual behaviour. I don't think is mandatory for this PR to address that, but might be good to have some direction to have that kind of test. puppeteer/playwright/cypress. WDYT @tesk9 ? |
You are very welcome to add puppeteer tests! The existing tests are primarily for running axe and percy against every example, but it's easy to amend the code to include additional assertions for a particular component. (You would want to adjust the component catalog example to include an example of the card pattern, I think, in order to test this properly). Run Add
in order to write custom tests against the Tooltip component. Please be sure that everything that is tested in |
Can we create custom elm apps for this? Having a sample app that will count/show parent click on disclosure tooltip does not seem a good fit for the catalog. Where could that app be placed? |
I disagree! I think that if there are common patterns in which components are used, and we want to make sure that these patterns continue to work, the Component Catalog is a great place to do so. If you don't think that the Tooltip example is where a clickable-card-with-tooltip-disclosure example fits, I think another alternative is to add a new page that is specifically for this pattern. I made a PR showing how this could be done: #1487 |
(I'll be OOO for the next few days. If you need a11ybat input, please talk to Charbel and Kristine 🙏) |
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.
@caseyWebb do you agree with the latest push?
I think this is good for now. Regarding puppeteer being so out of date, I wonder what the upgrade path there is and if we're using puppeteer anywhere else–if this is the only place it's used (and there is significant upgrade effort) I wonder if any effort should be put into migrating them to cypress instead of upgrading puppeteer. Not relevant for this pr, but a thought. |
(Looping in Charbel on the Puppeteer update thing separately - thanks much for raising!) |
I don't mind if we use puppeteer/cypress/playwright. I am not that experienced in either 😅 . My problem with the current state is that some documentation I found online was not working with 13.x since it's so outdated. Let's merge this as is and discuss/prioritize a migration path. |
#1490 - Feel free to edit/comment/work on that issue |
🔧 Modifying a component
Context
This PR changes the default click behavior for disclosure tooltips to preventDefault and stopPropagation on click. This allows nesting Tooltips within clickable regions such.
https://noredink.slack.com/archives/C02NVG4M45U/p1692639132232799
Closes KRA-1114
Component completion checklist
nriDescription