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
Don't offset last tab when scrolling #3777
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3777 +/- ##
==========================================
- Coverage 89.6% 84.71% -4.89%
==========================================
Files 206 152 -54
Lines 4867 3527 -1340
Branches 1223 1105 -118
==========================================
- Hits 4361 2988 -1373
+ Misses 408 406 -2
- Partials 98 133 +35
Continue to review full report at Codecov.
|
I don't agree with codecov here. Ideally there should be a special test case for the last tab. |
This doesn't actually resolve the underlying issue. The problem is scrollOffset is not being properly reset when isOverflowed changes, which happens when going from mobile to desktop. |
My current proposition for this fix: #3781. After running through, this ends up being more of a feature request. If I'm wrong please correct me. |
@johnleider I think you're correct, though I believe this solves the presentation of the underlying issue as a side effect. That said, I would think that scrolling past the end in any situation is still a bug, as it sends a signal to the user that there are more options off to the right when there are not, and it's inconsistent with the behavior of the overscroll on the left side since the left side will not overscroll beyond the first tab. |
It's only a bug if it wasn't intentional by us. The offset is intentional. Your logic in regards to it being a worse user experience, that may be, but this should still be a feature request to |
Sure. I wasn't sure scrolling on the last tab was intentional. I've updated the PR to target the dev branch. |
Does this still apply, and if so can you explain what it's actually about? The original issue appears to be fixed now. |
@KaelWD I'll have to build a new test case. Something has changed that radically altered how my codepen renders. |
@KaelWD No, this isn't fixed. I'll get a codepen together in a minute, but the short version is that if you have 6 tabs and only room on screen for 4 tabs, when tab 5 is selected you expect the bar to scroll so that you can see part of tab6, so you know something is there, but you would expect that when tab 6 is selected the right edge of tab 6 should line up with the right edge of the tab bar so that it's clear you're at the end of the list of tabs. Instead the behavior seen is that there is a gap between the right edge of tab 6 and the right edge of the bar, making it appear to the user as if there is another interactive tab when there is not. |
@KaelWD Here's an example pen. Make the view narrow enough to overflow the tabs and select tab 10 to see what I mean |
That's what the spec says should happen, it's actually incorrect because the left side is supposed to have that offset too. |
Could you point to the spec? This behavior increases user friction and as far as I can tell it deviates from every other material design implementation, including those by Google. |
I guess it doesn't say anything about the right-hand side, just that the left should align with the keyline. I don't really mind either way so I'm ok to merge this if the bossman is alright with it. |
fixes #3294
Description
Check if active tab is last in list and don't add an offset when scrolling if it is.
Motivation and Context
When using
grow
sometimes tabs would get scrolled (and offset) incorrectly.This change also improves look and feel of normal scrolling tabs
How Has This Been Tested?
visually
Markup:
Types of changes
Checklist:
master
for bug fixes,dev
for new features and breaking changes).