Using the latest version of Bootstrap (5.0) that supports importing from inline HTML, I am working on creating a toggle outline button as shown below.
<button type="button" class="btn btn-outline-dark" data-bs-toggle="button" autocomplete="off" aria-pressed="false" >{{mode}} Mode</button>
Upon the first click, the color instantly changes from transparent to filled. However, the issue arises when clicking it for the second time, as the button does not instantly change the color back from filled to transparent. One has to click elsewhere to trigger this change.
Is there a way to ensure that the color changes from filled to transparent instantly after clicking, without the need to click elsewhere?