-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 collapsed sidebar icons when scrollbars are present #8116
Fix collapsed sidebar icons when scrollbars are present #8116
Conversation
PR Summary
|
Forgot to mention I went ahead and included |
packages/panels/resources/views/components/sidebar/index.blade.php
Outdated
Show resolved
Hide resolved
Could you undo that change? I'd like to address that issue separately, as that's probably not the right fix (I recall removing that |
Thanks for taking the time to fix this issue, @archilex, appreciate it. Could you mark this PR as ready for review after you've implemented the changes I requested? |
My pleasure....I hope!...I was very hesitant to touch it since I know there are a lot of special cases to handle. Keep up the great work! |
So this issue is actually caused by the specific sidebar width we set? |
That sounds like good approach to me...Hopefully that would better handle alignment with the collapse button as well. Feel free to take it from here. I'm off to bed 🥱 |
Good night! I'm very busy as well (look at that long list of issues and PRs 😅). |
@zepfietje Morning! I'll work on this today when I get out of some meetings. |
Thanks for the detailed findings, @archilex! Have you found a way to make the collapsed sidebar expand on Firefox? The |
Sounds good. I'll test out using What do you mean by "Have you found a way to make the collapsed sidebar expand on Firefox?" It was expanding for me in Firefox...was it not before? |
@zepfietje I've looked into this and I don't think sticky is going to work. The good news is, as you said, using sticky and removing But there are several downsides:
sticky.mov
In summary,
Look forward to your insight and ideas. |
Thanks again, @archilex!
|
1a. However, this obviously mean that now ugly scroll lines get rendered on all browsers even when the content doesn't need to be scrolled.
|
|
Update: We can use I believe that resolves the major firefox issues.
If you're ok with the debugbar problem and the vertical scrolling problem on firefox then I can push these changes |
Nice! Does Also, do we still need to move to Could you share a screen recording of the overscroll issue on Firefox with |
Unfortunately, just using Therefore if you want to go that route we'll have to use sticky (fixed for mobile). As for side effects, besides the debugbar and firefox vertical scroll issue (video below) I don't see any other issues at all. I've tested this:
I have not tested on a mobile device. I'm going to go ahead and push these changes so you can see what's involved and we can refactor as needed since the Overscroll overscroll.mov |
Thanks again, @archilex. I think I'm happy to move to As for the Firefox overscroll issue that's pretty interesting, like, why does the main content not overscroll when you scroll past the bottom while it does for the sidebar? 🤔 |
Im fine to ditch the transition if it means this is fixed |
I'm fine with no transitions anywhere. LOL. |
Doing some comparissons, what I'm seeing is that in Firefox, when sticky is used, a container will overscroll on any side that reaches the boundaries of the viewport. So in the case of the sidebar, since I can even replicate this by with the top bar by making the browser very short so that the viewport is smaller than the height of the top bar. It will make the topbar overscroll just like the sidebar. The only issue I've found on bugzilla is this, but I'm not sure it's related: https://bugzilla.mozilla.org/show_bug.cgi?id=1772626 The problem is that this behavior is different than chrome/safari. In Chrome/safari overscroll applies to the entire page. Unles you have overriden then overscroll behavior, chrome/safari will just overscroll the entire page. I'm not sure what solution there is. I will say however that currently, the opposite is happening on our demo site. If you go there in firefox and scroll up (like pull to refresh), the body will overscroll but the sidebar will stay fixed. This is a separate issue, but I bring it up because if no one has brought this up as a bug, then they might not bring this up either. As for the transitions, I added them back on mobile...so should I remove them there too? Update: so I was playing around with |
Oh damn, I didn't notice the issue that was solved with the overscroll class on Chromium actually still exists in some way on Firefox... Honestly, I'm fine with the remaining issue after this PR then, because it isn't any more broken than it currently is. Transitions on mobile are fine.
Yeah... let's just give up on trying to fix that issue; should be fixed in the browser. |
Works for me. Anything else I need to do? Suggestions on a better way to add those |
Reverting, this is causing issues with flickering between page loads Screen.Recording.2023-09-10.at.00.07.03.mov |
Hmmm…I’ll take a look |
Which browser did you see that flickering on? I'm not getting it on chrome/firefox/safari on Mac. flickering.mov |
Nevermind...it happens when |
This reverts commit c2083fb.
Currently when 1) sidebars are collapsed and 2) scrollbars are always turned on, the icons will shrink due to there not being enough space for them expand. This PR fixes this by adding
items-center
to thenav
container which allows them to keep their width.Before:
After:
After with tenancy:
The following fixed has been tested and is working as expected in these scenarios:
The only issue, as you can see in the screenshot, is that when scrollbars are always on and the sidebar is collapsed the nav icons do not align with the collapse button at the top. Unfortunately, I don't think there is a way in css alone to know if scrollbars are turned on or not so I don't see a way to conditionally add/remove padding from the collapse button so they align.
Finally, I HAVE NOT TESTED ON WINDOWS/EDGE...Hopefully someone else can confirm on windows.
For additional background, at first I added
flex-shrink-0
to the icons which fixed the icon issue, but the buttonhover:bg-gray-100
was trying to fit within the padding so it was smaller than the expected 40px. Addingflex-shrink-0
to thebutton
has no effect since it's the icon is shrinking. Then I tried settingw-10
for the button, which works when collapsed in conjunction withitems-center
, but thenw-10
needs to be conditionally removed when the sidebar isn't collapased.Then I realized that just using
items-center
on the nav fixes everything...which honestly was a little surprising to me, but I'll take it.