-
Notifications
You must be signed in to change notification settings - Fork 211
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(picker): stop the click events from reaching the elements below picker-tray #5060
Conversation
|
Branch previewReview the following VRT differencesWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
If the changes are expected, update the |
Since this issue happens only in specific version(s) of iOS combined with the fact that we don't have a good testing infrastructure setup for mobile - I couldn't figure out a way to write tests for this which won't pass always. So I attached a before and after video in the description. |
Tachometer resultsCurrently, no packages are changed by this PR... |
Lighthouse scores
What is this?Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on Transfer Size
Request Count
|
Pull Request Test Coverage Report for Build 13114709204Details
💛 - Coveralls |
* This is a workaround for a bug in iOS <17 where the event leaks out of the dialog to the element below it. | ||
* Issue - https://github.com/adobe/spectrum-web-components/issues/5042 | ||
*/ | ||
this.dialogEl.addEventListener('pointerup', (event) => { |
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.
is pointerup
enough? Have we considered adding touchend
?
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.
Either of the two pointerup
or touchend
was working fine and similar to the other one in simulators... Didn't test it on a real device. Should I stop the propagation for both?
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.
I’m wondering if there’s any downside to having touchend
as a “safe fallback”... I don’t think it should be necessary, but without real device testing, it is hard for me to say 🤷
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.
I don't particularly see any other downside than the fact that in the worst case we're adding 1 extra event listener....so
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.
Does OverlayDialog
only get instantiated once, or is there a chance that the dialog may be re-instantiated? If so, should we define the event handler as a class method and attach/detach it?
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.
Yess! Thanks for the catch. Totally slipped my mind that we need to avoid attaching the event listener multiple times and clean it properly. Will update the code to do that.
I was thinking of having the logic of attaching and removing the listeners abstracted out and then will call that function to attach the listener when the dialog opens and remove it when it closes?
3c8deae
to
42c8612
Compare
42c8612
to
272fc0b
Compare
4d07c4f
to
a413ae8
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.
LGTM 🚢
@TarunAdobe should we add in a test to confirm this behavior? or is this a device emulation issue? |
I made a comment on this PR abt this that got lost between all the bot comments but TLDR; Since this issue happens only in specific version(s) of iOS combined with the fact that we don't have a good testing infrastructure setup for mobile - I couldn't figure out a way to write tests for this which always end up passing. And so it'd be useless :( |
Description
Stop the click events to reach the element below tray when we open a picker in iOS <17
Related issue(s)
Motivation and context
How has this been tested?
Go here in iOS<17
Manually Tested. See the attached Video below for before and After:
Before
screen-capture.webm
After
screen-capture.1.webm
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
.