-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4: Cannot use input of a popover inside modal #22249
Comments
👍 |
remove tabindex="-1" of your modal it'll work.put the below line without tabindex here is example fiddle |
IMO @satyajit11 give a correct answer (see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex). I'm not sure it's a Bootstrap bug here, any advice @mdo or @bardiharborow ? |
Our docs include |
@Johann-S when add popover code it is append to body which is outside modal because we already have tabindex="-1" so focus won't go there.I don't proper js solution but i think we need to append inside the container or remove focus from modal when we add popover |
Removing the tabindex from the modal solved my problem. Can i close the issue or there is here a bug in Bootstrap to solve? |
As @mdo said we should update our documentation and remove |
removing the i'd suggest the problem is in the popup and the way it's generated, rather than the modal itself. |
When #22263 will be merged @nunofilipesf you'll have to update your code to the following by adding $(document).ready(function () {
var popoverContent = '<div> \
<select class="form-control mb-1"> \
<option value="eq">Is equal to</option> \
<option value="ct">Contains</option> \
</select> \
<input type="text" class="form-control"> \
</div>';
$('#exampleModalLong').on('shown.bs.modal', function (e) {
var popover = $('#popover-btn').popover({
title: '',
placement: 'bottom',
html: true,
content: popoverContent,
trigger: 'manual',
container : '#exampleModalLong'
});
});
$('#popover-btn').click(function () {
$(this).popover('show');
});
|
I tried this with the changes in the pull-request + tether 1.4.0. Tried adding an id to the modal-element and using that as the container, but I'm having issues with the position of the popover as soon as there is a scrollbar / long content in the modal. Seems like the popover moves twice as much as it should on the y-axis. Is this something known, or am I doing something horribly wrong? :) |
Please @DavidEmanuelsen post a JSBin or a CodePen to see your issue thank you |
https://jsfiddle.net/w8yh65cr/3/ Slightly ugly jsfiddle, not sure how to reference bootstrap including the changes you've made. |
It seems Tether determine position of the popover according to the scroll position 🤔 |
The "append" option of Tether accepts only an element that is identical to body, nothing different. (same size, same position, same everything). This, and lot of different problems, were the reason that convinced me in opening this PR: More info at shipshapecode/tether#204 |
Closed and fixed by #22444 |
As of today, with the newest version, I'm still experiencing this issue. |
I'm still experiencing this issue too, |
Hi @dersar00, It seems related to your code because you have a live example which work here: https://getbootstrap.com/docs/4.3/components/modal/#tooltips-and-popovers Anyway it's pointless to comment on a closed issue, if you have an issue open a new one with a live test example 👍 |
I've tried to create a modal with a popover inside.
This popover has html content with an input and a select.
If i open the modal and the popover, i can use the select, but not the input.
Also, the focus is not on the input.
Sample here: https://jsfiddle.net/bpx3zsyz/2/
Tested in Chrome, Edge and Firefox, always with the same behaviour
The text was updated successfully, but these errors were encountered: