Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
I made a CouchCMS CouchCart using the template provided which includes a modal ajax driven cart. It seems on the whole to be working quite nicely except the modal cart WILL NOT CLOSE! It's driving me crazy.

It's a simple data-dismiss=modal which is the very same link I have in another modal on the same page which works absolutely perfectly.

Have a play:

LINK REMOVED. SEE NEXT POST

Add something to cart and up comes the (unstyled) cart. Which then won't close.

But the link at the bottom opens a modal no problem, which DOES close using the very same close link.

What's going on!?!?

TY!

Solved!

Unsure why but the HTML for the modal seems to require certain content in Bootstrap 4.0 in order for the close to be successful. No errors are generated when it doesn't work and the clicks on the buttons which lead to a close are all processed correctly. But this modal dialog will not close by any means (direct calls to modal('hide'), use of data-dismiss='modal' etc etc etc):

Code: Select all
    <!-- Cart Modal -->
    <div id="cart-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-body"></div>
            <button class="modal-close" data-dismiss="modal" title="Close">&times;</button>
    </div>


Whereas this one closes without issue:

Code: Select all
    <!-- Cart Modal -->
    <div id="cart-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">           
            <div class="modal-body" id="cart-modal-body"></div>
            <button class="modal-close" data-dismiss="modal" title="Close">&times;</button>
        </div>
    </div>


Note however that the change to the HTML necessitates a change to the jQuery reference to the modal body in file cart-modal.js.
2 posts Page 1 of 1