bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Bootstrap doesn't allow more than one instance per element. Bound instance: bs.dropdown

Open DJafari opened this issue 1 year ago • 4 comments

Prerequisites

Describe the issue

i want show tooltip on dropdown toggle button

i thinks it's bug, why i can't use two different component for one element ?

Reduced test cases

https://codepen.io/Davood-Jafari/pen/yLGXWXX

const el = document.querySelector('#myBtn');
new Dropdown(el);
new Tooltip(el);
<div class="dropdown">
  <button
    id="myBtn"
    class="btn btn-secondary dropdown-toggle"
    data-bs-title="Default tooltip"
    type="button"
    data-bs-toggle="dropdown"
    aria-expanded="false">
    Dropdown button
  </button>
  <ul class="dropdown-menu">
    <li>
      <a class="dropdown-item" href="#"> Action </a>
    </li>
    <li>
      <a class="dropdown-item" href="#"> Another action </a>
    </li>
    <li>
      <a class="dropdown-item" href="#"> Something else here </a>
    </li>
  </ul>
</div>

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

5.2.3

DJafari avatar Sep 14 '23 12:09 DJafari