简体   繁体   中英

Bootstrap popover on Android disappears after page scroll

I have a question about bootstrap popover - javascript plugin. Popover has got text input inside, and when viewing this page on normal browser, I can click on this input and enter data.

But in android, when I open popover and click input, the keyboard appears but popover disappers.

On iOS popover works as expected, but on Android it dissapears. My code is generic, and simple:

$('.logMe').popover({
            html: true,
            placement: 'bottom',
            content: function() {
                return $('#login').parent().html();
            }
        })

Thank You for any advice.

This is a known bug. The current workaround is a listener that will close it. Something like this:

$('*').bind('touchend', function(e){
   if ($(e.target).attr('rel') !== 'tooltip' && ($('div.tooltip.in').length > 0)){
        $('[rel=tooltip]').mouseleave();
        e.stopPropagation();
   } else {
        $(e.target).mouseenter();
   }
});

This worked for me:

$(window).resize(function () {
   $(window).refreshPosition();
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM