prevent dialog view for jquerymobile multi select control with large list of options

前端 未结 3 1400
失恋的感觉
失恋的感觉 2021-02-09 05:25

So I like the custom multi select control that jquery-mobile has and want to use it. So please don\'t suggest put data-role=\"none\". But I just don\'t want the default behavior

3条回答
  •  甜味超标
    2021-02-09 06:07

    Perhaps I found a simpler solution using css

    .ui-selectmenu{
        max-height: 500px;
    }
    

    This prevent jquery mobile to recognize long list of option and it doesn't create dialog.

    Note that this will happen for all select controls.

    It's better to limit this option only for desktop user, to use the full page dialog in mobile, where is very useful. e.g. using

    @media screen and (min-width: 768px) {
        .ui-selectmenu{
            max-height: 500px;
        }
    }
    

提交回复
热议问题