Skip to content
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

Sidebar closes when user scrolls it with touch #48

Closed
d--j opened this issue Dec 8, 2017 · 4 comments
Closed

Sidebar closes when user scrolls it with touch #48

d--j opened this issue Dec 8, 2017 · 4 comments
Assignees
Milestone

Comments

@d--j
Copy link

d--j commented Dec 8, 2017

Expected Behavior

The Sidebar should be able to be scrolled without being closed thereafter.

Actual Behavior

When a user scrolls the sidebar with touch and she happens to end the scroll on a link (<a> tag) then the sidebar closes.

Steps to Reproduce the Problem

  1. Go to https://www.mbi-geodata.com/en/ with a mobile browser or in mobile device emulation
  2. Open the off canvas mobile navigation
  3. Scroll the off canvas navigation with touch (or on mobile device emulation with clicking and dragging the mouse) – not with the scroll bar or with scroll functionality of your mouse.
  4. The off canvas sidebar closes

Specifications

  • Plugin Version: 0.4.2
  • WordPress Version: 4.9
  • Other plugins installed: admin-menu-editor advanced-export-for-wp-wpmu bwp-google-xml-sitemaps black-studio-tinymce-widget bulk-content-creator cms-tree-page-view content-aware-sidebars uk-cookie-consent display-posts-shortcode flowpaper-lite-pdf-flipbook gravityforms multisite-cloner multisite-language-switcher newsletter nextend-smart-slider3-pro nextgen-flex-slider-template nextgen-gallery nextgen-mbi nextgen-gallery-plus off-canvas-sidebars pods really-simple-ssl responsive-lightbox shariff shortcode-menu tinymce-advanced tinymce-and-tinymce-advanced-professsional-formats-and-styles user-switching w3-total-cache widget-clone wordpress-popular-posts wp-piwik yith-footer-banner wordpress-seo
  • Theme: not public
  • Browser: All Touch-Enabled (tested in Android 7, iOS 11 and Chrome with mobile device emulation)

Pointers

This code is probably responsible for this behaviour:

// Close the slidebar after clicking a link.
$( 'a' ).not( '.' + prefix + '-trigger' ).on( 'touchend click', function() {
if ( ! $(this).parents( '.' + prefix + '-trigger' ).length ) {
controller.close();
}
} );

Why do you include touchend in the list of events there? Doesn't all touch enabled browser emulate the click event?

@JoryHogeveen
Copy link
Owner

Hi @d--j

Sorry for my late reply. I'm aware of this issue and will release a minor update a.s.a.p. An extra enhancement is that this behavior will be a global setting, over-writable for each sidebar.
I will notify you when I push it to GitHub!
For now you can remove those lines of code.

Why do you include touchend in the list of events there? Doesn't all touch enabled browser emulate the click event?

Unfortunately no. Some browsers do not trigger the click event for touch devices.

Regards, Jory

@JoryHogeveen JoryHogeveen added this to the 0.4.3 milestone Dec 18, 2017
@JoryHogeveen JoryHogeveen self-assigned this Dec 18, 2017
@JoryHogeveen JoryHogeveen mentioned this issue Jan 3, 2018
Merged
21 tasks
@JoryHogeveen
Copy link
Owner

Hi @d--j
If you are able, please check the PR for the new 0.5 version!
It's currently tagged as 0.5-dev so you will still be notified of any live updates through WP.
Thanks, Jory

@d--j
Copy link
Author

d--j commented Jan 3, 2018

Hi @JoryHogeveen
looks like 0.5-dev solves this issue. Thanks very much.

@JoryHogeveen
Copy link
Owner

Hi @d--j
Great, I'll close this issue and will release 0.5 a.s.a.p.!

Thanks for testing and if you have the time, please leave review, it will help this plugin grow 🙂
https://wordpress.org/support/plugin/off-canvas-sidebars/reviews/

Cheers, Jory

@JoryHogeveen JoryHogeveen modified the milestones: 0.4.3, 0.5 Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants