overflow-y not working in safari inside a modal

后端 未结 10 1006
攒了一身酷
攒了一身酷 2020-12-29 03:04

Ok here is the html:

相关标签:
10条回答
  • 2020-12-29 03:23

    You can set overflow-y:hidden; after overflow auto, and on safari at least that rule will be applied. Ref.

    0 讨论(0)
  • 2020-12-29 03:24

    you can try this, it work fine for me

    #filterOptionsContainer {
        overflow: auto; 
        overflow-y: auto; 
        overflow-x: hidden; 
    }
    
    0 讨论(0)
  • 2020-12-29 03:35

    You can try this. It's working fine with Safari.

    #filterOptionsContainer {
      overflow-y: scroll;
      -webkit-overflow-scrolling: touch;
    }
    
    0 讨论(0)
  • 2020-12-29 03:35

    I resolved this by switching to a multiselect (and hiding the scrollable div) on mobile devices (so no real solution). Thanks for all the help everyone.

    Edit: I have finally figured this out. Basically what happened was that after I switched to using a multiselect, it too was acting weirdly in IOS devices when using Safari.

    In examining further a colleague of mine noticed dojo touch events on both the scrollable div and on the multiselect (the template I am using uses dojo). I started looking around in the template's source to figure out why these events were being attached to all these elements and I noticed a dojo module called "dojo/touch". After removing this module from the project, the elements are working fine in Safari.

    The take away is that 'dojo/touch' and IOS Safari are totally incompatible.

    0 讨论(0)
  • 2020-12-29 03:36

    Try applying this inline , or through a Jquery Script

     style="overflow-y: scroll; -webkit-overflow-scrolling: touch;"
    

    or through a Jquery Script

    $("#filterOptionsContainer").css({
        "overflow-y": "scroll",
        "-webkit-overflow-scrolling": "touch"
    });
    
    0 讨论(0)
  • 2020-12-29 03:36

    For future readers, overflow does not work on safari with display: flex You must use display: block

    0 讨论(0)
提交回复
热议问题