Currently, I am working on a nuxt.js project and have a question regarding the use of modals with Bootstrap. Does displaying a modal using Bootstrap's modal add an entry to the browser's viewing history? https://i.sstatic.net/h4qjN.jpg
Here is the issue I am facing: I have two pages - page A and B.
- Page A contains a button that links to page B. I used $router.replace for programmatic navigation, so it should not be added to the history.
- Page B has a button to show a modal, which includes a close button that takes you back to page B once clicked.
The problem arises when I open and close the modal. To go back to page A, I have to press the browser's back button twice. For example: Show modal on page B -> Close modal on page B -> Press the browser's back button (the URL remains on page B) -> Press the back button again to return to page A.
My assumption is that showing a modal using Bootstrap adds a new history entry.
Add this section later
Below is the code for the modal:
// Display modal
<button data-toggle="modal" data-target="#removeModal">Show modal</button>
// Dismiss modal
<div class="mdal fade" id="removeModal">
<p data-dismiss="modal">
<img src="@/assets/img/x-icon.png" alt="X-icon">
</p>
</div>