Multiple data-toggle not working correctly - Bootstrap 4 -


i have following page: http://mindspyder.com/newline/my-account.html

and following code on page:

<!-- nav tabs -->    <ul class="nav nav-tabs" role="tablist">    <li class="nav-item"> <a class="btn btn-primary btn-sm" href="#" role="button"><i class="fa fa-search-plus"></i> view</a> </li>    <li class="nav-item"> <span data-toggle="modal" data-target="#mymodal"><a class="btn btn-primary btn-sm" href="#delete" role="tab" data-toggle="tab"><i class="fa fa-times"></i> delete</a></span></li>    <li class="nav-item"> <a class="btn btn-primary btn-sm" href="#download" role="tab" data-toggle="tab">settings</a> </li>  </ul>    <!-- /nav tabs -->   <!-- tab panes -->    <div class="tab-content">    <div role="tabpanel" class="tab-pane active" id="review"></div>    <div role="tabpanel" class="tab-pane" id="edit"></div>    <div role="tabpanel" class="tab-pane" id="delete">hello</div>    <div role="tabpanel" class="tab-pane" id="download">      <p>      <form>        <p>          <label>            <input type="checkbox" name="checkboxgroup1" value="invoice" id="checkboxgroup1_0">            invoice</label>          <br>          <label>            <input type="checkbox" name="checkboxgroup1" value="establishment kit" id="checkboxgroup1_1">            establishment kit</label>          <br>          <label>            <input type="checkbox" name="checkboxgroup1" value="declaration of custody trust" id="checkboxgroup1_2">            declaration of custody trust</label>          <br>          <label>            <input type="checkbox" name="checkboxgroup1" value="trustee minutes" id="checkboxgroup1_3">            trustee minutes</label>          <br>          <label>            <input type="checkbox" name="checkboxgroup1" value="compliance letter" id="checkboxgroup1_4">            compliance letter</label>          <br>        </p>      </form>      </p>      <p>        <button type="button" class="btn btn-success btn-sm">download selected <i class="fa fa-arrow-down"></i></button>      </p>    </div>  </div>    <!-- /tab panes -->

now, if go page , click blue delete button, works perfectly. if click cancel, , click on 1 of other tabs, still works should. problem click delete again, doesn't switch delete tab when opening modal, leaves on previous tab.

what doing wrong?

i figured out, changing nesting, so:

<span data-toggle="modal" data-target="#mymodal"><a class="btn btn-primary btn-sm" href="#delete" role="tab" data-toggle="tab"><i class="fa fa-times"></i> delete</a></span> 

becomes:

<a class="btn btn-primary btn-sm" href="#delete" role="tab" data-toggle="tab"><span data-toggle="modal" data-target="#mymodal"><i class="fa fa-times"></i> delete</span></a> 

and works should.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -