Choices icon indicating copy to clipboard operation
Choices copied to clipboard

Touch scrolling inside dropdown broken on mobile

Open BrechtVds opened this issue 4 years ago • 7 comments

Describe the bug When touch scrolling inside a dropdown the window gets scrolled instead of the dropdown options.

To Reproduce Steps to reproduce the behavior:

  1. Go to the Choices demo site on mobile
  2. Click on the "Fake Tales Of San Francisco" dropdown under "Single select input"
  3. Try scrolling the options inside the dropdown
  4. The options will scroll a tiny bit, but then window scrolling seems to take over

Expected behavior The dropdown should scroll, not the window.

Screenshots ezgif-3-0b988fbb45d8

Smartphone (please complete the following information):

  • Device: iPhone 11 Pro
  • OS: iOS 13.5.1
  • Browser Safari or Chrome

BrechtVds avatar Jun 15 '20 09:06 BrechtVds

I can't reproduce this issue with Android 9 and Chrome 83.

nboisteault avatar Jun 23 '20 09:06 nboisteault

I have also run into this issue with iOS Safari

jamesdward avatar Jul 21 '20 07:07 jamesdward

I have also this problem with iOS. Interesting thing is, that when you select a value from the list once, it starts to work as it should. So it doesn't work only on the initial load of the page

hurt0n avatar Jul 21 '20 12:07 hurt0n

This is how I fixed it:

choices.passedElement.element.addEventListener('showDropdown', () => {
    $('.choices__list').hide();

    setTimeout(() => {
        $('.choices__list').show();
    }, 1);
}, false);

southofthree avatar Jul 24 '20 06:07 southofthree

This is how I fixed it:

choices.passedElement.element.addEventListener('showDropdown', () => {
    $('.choices__list').hide();

    setTimeout(() => {
        $('.choices__list').show();
    }, 1);
}, false);

@southofthree For me this just keeps the menu hidden and breaks completely. Did you add something else?

aaronjpitts avatar Aug 12 '20 17:08 aaronjpitts

This is how I fixed it:

choices.passedElement.element.addEventListener('showDropdown', () => {
    $('.choices__list').hide();

    setTimeout(() => {
        $('.choices__list').show();
    }, 1);
}, false);

@southofthree For me this just keeps the menu hidden and breaks completely. Did you add something else?

@aaronjpitts no, nothing else

southofthree avatar Aug 13 '20 02:08 southofthree

I am not able to replicate this anymore as of iOS 14, so it looks like Apple might have fixed something on their end.

BrechtVds avatar Sep 24 '20 13:09 BrechtVds