Twitter tooltip shown behind modal

I have a tooltip with a range inside the input group that appears in the modal popup behind the main modal div.

This is my tip inside the form group.

<div class="form-group margin-none innerB">
<label for="form_field_name" class="col-sm-3 control-label">label</label>
<div class="col-md-9">      
    <div class="input-group">
        <input type="text" id="form_field_name" name="form_field_name" class="form-control" value="0" readonly="readonly" />
        <span class="input-group-addon" data-toggle="tooltip" data-container="body" data-placement="top" data-original-title="tooltip text"><i class="fa fa-question-circle"></i></span>
    </div>
</div>

And this is my modal:

<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="modalLabel">Modal Title</h4>
        </div>
        <div class="modal-body">
            <div id="modal_body" class="modal-body padding-none">
                <div class="lead separator center relativeWrap">
                    <p class="innerTB margin-none">
                        <i class="fa fa-fw fa-spinner fa-spin"></i> loading
                    </p>
                </div>          
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
    </div>          
</div>

solvable

I fixed the problem by changing it:

data-container="body"

for

data-container=".modal-body"
+4
source share
1 answer

Modals have a higher z-index, check its z-index and give higher than the tooltip. This can solve the problem.

+3
source

Source: https://habr.com/ru/post/1535715/


All Articles