-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
iOS <=16.1.1 - Scrolling becomes locked when overlayscrollbars is initialized #682
Comments
Good day @lincolnthree :) I'll take a look as soon as possible.. could you check whether this behavior exists only on iOS or is also present on MacOS Safari? |
@lincolnthree I've looked at it and it seems that its not directly related to I've digged into your markup and code and analyzed it. First of all I've never really tested the library with ShadowDOM but it seems to work properly. Then there a few things I noticed regarding your target options: {
target: elements.viewport,
elements: {
viewport: elements.viewport,
content: elements.fixed,
host: elements.content,
padding: null
},
scrollbars: {
slot: elements.background
}
} I would strongly recommend to not set the Then you have the I've compared the DOM between an If you compare both and take a look at the It seems like in older Safari versions the styling of .inner-scroll {
height: calc(100% - var(--offset-bottom) * -1);
bottom: auto;
} |
Hey @KingSora! First. Wow. I was absolutely stunned to see your response on Friday. It was both incredibly quick AND you already figured out a solution. Seriously impressive for any software these days, even (or especially) open source. Thank you. I would have replied sooner but weekends are tough! Your library is incredibly helpful by the way, so thank you again. I should have loaded a demo on the iPhone simulator. My apologies for not thinking of that! Config: Style issue with For whatever reason, once I had been using throttled scroll events themselves to update the I've found this scroll locking after init occurs regardless of browser, and it seems that Safari <=16.1.1 issue is the same issue, but appears to always cause this scenario due to the calculations you discovered above. Scrolling works fine until Thoughts? Thanks again! |
Small update. That style does force things into a working state (yay!), but in this case I think we also need to include the
|
@lincolnthree Thanks for your kind words, I really appreciate them! :) I always try to do my best in terms of support, since I would like to receive it myself as soon as possible, so I'm trying to lead by example. I just found out that the /* has higher specificity than the "[data-overlayscrollbars]" selector */
.inner-scroll[data-overlayscrollbars] {
position: absolute;
} This should have the same outcome and be closer to the intended style. Regarding the issue of I guess thats something I could improve in a future release (possibly with a Plugin), but for now you'll have to continue with your manual updates workaround (or you don't use the shadow dom). Edit after a little bit of research: |
It is appreciated! I try my best with my own libraries but I need more hours in the day.
Oh. Yeah. Look at that. That would definitely do it. Hah! In addition to Safari being Safari of course. Did that style change in a recent
It does indeed! Great catch.
Yeah. Agreed. Not sure you should even try, to be honest. Every situation would be different unless you want to maintain plugins for various frameworks... You already provide all of the hooks necessary for people to be able to get handles to their elements and do the init. Maybe add a section to the docs to call out this scenario? Might be the most practical option, thorough explanation of the issue & caveats. One other thing I found with the Shadow DOM is that I have to programmatically inject the entire
EDIT: Actually, a config option for injecting the stylesheet into an element might be useful. Right now I have to do that by copying the entire |
The style itself didn't change, but the specificity of the selector did.. The reasoning was to better support frameworks like I'll take a look what utils / plugins I could provide in order to better support ShadowDOM (such as injecting styles, observing elements etc.). Related: #402 |
Makes sense. Thank you again :) I'll keep tabs on that issue! EDIT: Just kidding I commented on it last year before I figured all this out. |
I'm closing this issue since your specific case should be resolved.. The "Shadow-DOM support" issue will keep track of that specific feature |
Perfect, thanks! |
Describe the bug
When overlay scrollbars are initialized, scrolling is locked even though there is overflow. The same code works in newer iOS/Safari mobile environments and on other platforms, so I am not sure what is happening exactly. I believe it has to do with the measurement of overflow in Safari of this version.
Is there any way to disable scroll locking through the config?
overflowAmount
is always0
,hasOverflow
is alwaysfalse
:Other devices with the same code report overflow correctly:
I think it may be also related to this change, though I am not super familiar with the internals of OLS: 082e275#diff-e23943117c0ab8a43c6f67973a7535bceee73babb7404d15118e8ad52df12776R136
To Reproduce
Note: https://www.topdecked.com itself works because overlayscrollbars is not initialized on the home screen (same for some other screens.)
Expected behavior
Scrolling should work and should not be locked.
Examples
Apologies. It will be difficult to create a sample of this as we have a custom integration and are using Ionic framework, but the bug does not appear to be present in overlayscrollbars 1.8.x
But here is our init code:
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: