-
Notifications
You must be signed in to change notification settings - Fork 5.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
Off-Canvas contentScroll inner scrollbox #10538
Off-Canvas contentScroll inner scrollbox #10538
Conversation
…ement that can be touch moved even if contentScroll is set false
This looks good to me! Thanks for the pen! |
I think we'd need to document this approach... that said, part of me wonders if we could fix the original handler to not need this... perhaps by checking the target in the event handler and not preventing default/propagation for inner elements? |
@kball I 100% agree: we should definitely find a way without extensive usage of In a current project I've added dozen of these attributes but it's still not working in all cases. Precisely I've great problems with a slider that is dynamically build and uses touch events (which are getting prevented by the off-canvas). As far as I see the whole touch event listeners are primarily created for iOS. Any idea how to stop propagation (so the body's |
I'm coming back to this issue since I'm more and more reaching the limits of the current touch handling of the off-canvas (if contentScroll === false). Firstly I've come to the conclusion there's probably no way around the additional So imo it's unavoidable to have such a markup <div class="off-canvas" id="test" data-off-canvas data-content-scroll="false">
<p>Lorem ipsum</p>
<div id="innerTest" data-off-canvas-scrollbox>
<p>dolor sit amet</p>
</div>
</div> Secondly I've got an UI issue with the scrollbox feature. It would be more intuitive to cause a scroll down/up in the off-canvas if the user has reached the end of the inner scrollbox and is still touch moving down/up. I'm currently working on this additional scroll continue feature. @kball hope this is ok for you? |
Instead of keeping the touch move inside the scrollbox it now affects the outer off-canvas if the user has reached the end of the scrollbox. This way the user can continue to touch move down/up without the need to place his finger outside the scrollbox.
Done! I've now extended the present _stopScrollPropagation function to affect the outer off-canvas as well (if called from the scrollbox). @kball @IamManchanda would be great if can review this PR! p.s. if you wonder why I've also added |
@ncoden I've just run into the same issue for another project. I've created a new, simple codepen that shows the issue pretty well. Without my fix (checkbox unchecked) this doesn't work. |
@SassNinja I am not able to make it works with the codepen you given. I tested with both Firefox dev tools and BrowserStack (safari on iOS 11). Should the drilldrow scroll on mobile ? |
@ncoden I think FF doesn't emulate the touch behavior appropriately. The drilldown is supposed to be moved. |
Hmm.. I am unable to reproduce the "patch" in https://codepen.io/KaiTheGreat/pen/oELvLB See: https://giphy.com/gifs/l3nSOjb8rbfQIfYBi (in Giphy because this is a huge gif) |
Which Chrome version was used for testing and what can we do here? Is some more testing needed? |
I think we need an example which always reproduces the issue in talk (not only on my side). I'll try to create another, more complex codepen that hopefully always shows the issue. |
The following codepen shows an off-canvas with advanced/complex content, that causes issues on mobile if having set @ncoden would you please check again? Do you have problems to touchmove on mobile this time (if checkbox unchecked)? In the course of creating this codepen I also reviewed my code for this feature to see if there's a chance to make it more simple. But I didn't find any way to keep all the content within the off-canvas working without offering The scrollbox is required because the touch event listeners must also be added to every scrollable container within the off-canvas (in particular needed for iOS – not reproducible with chrome dev tools). The outer scrollbox is required in cases where the off-canvas element is not the scrollable container of the content (e.g. when using a 'pseudo fixed body' as shown in my codepen). If this PR is good so far (and the issue in talk reproducible) I'll adjust the docs and explain the scrollbox feature there in detail. A note regarding the noUiSlider (in the pseudo accordion): |
Poke @ncoden Are you able to reproduce the issue (and the fix) with my latest codepen? |
I missed your reply. I'll check that again when I have some time. |
I'd like to finish this PR... My latest codepen is still relevant: Since the codepen is probably a very very specific use case (and bcz it should be done anyway) I've added a section in the docs to describe this incl. a simple example. @ncoden @DanielRuf would be awesome if one of you could manage to take a look! |
should be always https
This pull request has been mentioned on Foundation Open Source Community. There might be relevant details there: https://foundation.discourse.group/t/foundation-for-sites-v6-6-0-is-here-farout/30/1 |
I've been facing an issue with the off-canvas option
contentScroll: false
when using an inner box in the off-canvas with a specific height that is supposed to be scrollable.Due to the touchmove and touchstart event listeners you can't touchmove on mobile devices within that box.
You can find an example here:
https://codepen.io/KaiTheGreat/pen/mMBZjp
Simply open the codepen on a mobile device (or use e.g. the chrome dev tools with touch emulation), click the red alert button and try to touchmove in the gray box.
This PR fixes the issue be adding additional listeners to
[data-off-canvas-scrollbox]
which is supposed to be assigned to the inner box.I've extended the visual test
offcanvas/nested.html
to show the fix.@kball @IamManchanda @brettsmason what do you think about this?