willmcpo / body-scroll-lock

Body scroll locking that just works with everything 😏
MIT License
4.04k stars 337 forks source link

[SOLVED] Scroll inside popup disabled also #126

Closed jlgouwyapizr closed 5 years ago

jlgouwyapizr commented 5 years ago

Hello,

The body scroll is perfectly locked. but inside the popup, on mobile safari, I have a scroll also on paragraph element. This scroll doesn't work either.

this is the code I use :

$('.btn-open-panel').on('click', function(e) {
    e.preventDefault();

    const idPanel = $(this).data('panel');
    const panelElement = $(idPanel);

    if(panelElement.hasClass('visible')) {
      panelElement.removeClass('visible').addClass('hidden')
      bodyScrollLock.clearAllBodyScrollLocks()
    } else {
      panelElement.addClass('visible').removeClass('hidden')
      disableBodyScroll(panelElement);
    }

    return false;
  });

Even without scroll inside the popup, my popup is not scrollable (if the content is bigger than the screen). The popup style is :

position: fixed;
    top: 0;
    height: 100vh;
    z-index: 9999;
    margin-left: 100%;
    padding: 20px 6% 0;
    overflow-y: scroll;

if you have any solution, thanks in advance

diachedelic commented 5 years ago

You may want to investigate the allowTouchMove option

jlgouwyapizr commented 5 years ago

Oh yes ! I missed this ! Thanks