-
Notifications
You must be signed in to change notification settings - Fork 205
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(tabs): scroll exceeding tabs limit #4722
Conversation
3913223
to
d3b3230
Compare
d3b3230
to
5182d9e
Compare
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 11269714249Details
💛 - Coveralls |
Tachometer resultsChrometabs permalinkbasic-test
top-nav permalinkbasic-test
Firefoxtabs permalinkbasic-test
top-nav permalinkbasic-test
|
Great Start! Would you also be interested in creating a test case for this so that we can surface this up and make sure that we get non-breaking changes. |
I've been trying to get that working but wasn't able to create a test for it. I tried to focus the Also, I'm not aware how I can make a test specific for iOS, where the problem is. Are there any guidelines in SWC for this type of situations? |
I am working with the playwright team to work on a solution to enable touch specific renderers which will help us test mobile specific touch events. |
packages/tabs/src/Tabs.ts
Outdated
@@ -235,12 +235,26 @@ export class Tabs extends SizedMixin(Focusable, { noDefaultSize: true }) { | |||
return this.rovingTabindexController.focusInElement || this; | |||
} | |||
|
|||
private limitDelta(min: number, max: number) { |
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.
Please add a documentation block on these methods!
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 for pointing that out. Indeed this method especially seemed somewhat ambiguous. I changed it's implementation so that it does the same thing but in a cleaner manner. What are your thoughts on this?
Please pull this up to |
expect(tabsOverflow['overflowState'].canScrollRight).to.be.true; | ||
}); | ||
|
||
xit('should scroll up to the last item and back in RTL', async () => { |
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.
Would it work and make sense to let these tests run, even without setting the user agent?
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.
We can run the tests if we remove the setUserAgent
part, this is how I created them in the first place. I think it would make sense to run these for desktop as well, to cover the scenario.
The thing with this approach is that they wouldn't fail even if this bug is reproducible on iOS and I think is good to signal in some way that these tests must be enabled once we have a way to run them on iPad/iOS/Android. I'm thinking to enable them in the current tests contexts and commenting the setUserAgent
part, along with a comment like this:
// TODO: run on iPhone as per https://github.com/adobe/spectrum-web-components/pull/4722
What do you think, do you have any suggestions on this?
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.
Yes, I think that approach is good. While this bug is iOS-only, this test is running in a mobile viewport which still helps with our testing coverage 👍
b348ab6
to
cb31e92
Compare
6e22ef8
to
67cf3ef
Compare
2158736
to
fabe43c
Compare
fabe43c
to
4cc9f6d
Compare
Description
This PR aims to address said problem by limitting the delta a consumer can pass to the
scrollTabs
public method, used insp-tabs-overflow
.Related issue(s)
Motivation and context
Currently on iOS devices the user can still act upon the "left/right" chevron icons to scroll through the tabs even when there are no more tabs to scroll to. Also, an empty space is visible when scrolling to the right/left most tab.
How has this been tested?
Test case 1
Test case 2
Test case 3
Test case 4
Did it pass in Desktop?
Did it pass in Mobile?
Did it pass in iPad?
Screenshots (if appropriate)
Screen.Recording.2024-09-04.at.16.04.58.mp4
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
.