I'm trying to put a dropdown list inside the twitter bootstrap popover. The popover should be triggered on link's hover event and remain visible while cursor is inside the popover.
I used a code posted by @vikas devde from here to make it work, and everything works great except selecting an option from a dropdown list.
When trying to select an option, dropdown disappears.
In Firefox there is a chance to select by keyboard arrows, Chrome allows to select but hides the popover on click or on enter, in Safari everything works fine.
Here's a fiddle for illustration.
HTML:
<a id="hover-link" href="#">Hover over me</a>
<form id="form-popover" method="post">
<label>Select some option here
<select>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</label>
</form>
jQuery:
$(function () {
$('#hover-link').popover({
html: true,
trigger: 'manual',
placement: 'bottom',
content: $('#form-popover').html(),
title: "title"
}).on("mouseenter", function () {
var _this = this;
$(this).popover("show");
$(this).siblings(".popover").on("mouseleave", function () {
setTimeout(function () {
$(_this).popover('hide');
}, 100);
});
}).on("mouseleave", function () {
var _this = this;
setTimeout(function () {
if (!$(".popover:hover").length) {
$(_this).popover('hide');
}
}, 100);
});
});