简体   繁体   中英

Bootstrap Popover Ignoring Placement Option

I have a select inside a bootstrap modal that contains options with bootstrap popovers containing a more detailed description of each option. Currently no matter what I set the placement option to in the popover initialization, it pops up in the middle of the select box, covering the other options in the list. The select allows multiple options to be selected so this is not ideal for user experience. Looking at similar questions, I thought that setting container: 'body' would help, but the issue persisted as shown here:

Popover
截图图片

My current popover initialization:

$('#selectId>option').popover({
    container: 'body',
    html: true,
    placement: 'right',
    trigger: 'manual',
});

I have tried changing the position to 'left', 'top', and 'bottom', and no matter which option I use, the popover appears in the same position when I trigger it using $('#selectId>option').popover('show')

Try giving more width(space) for select box because sometimes "popover" needs more space for that placement.

data-placement="right"

and use an attribute like this.

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