Why isn't my Cart Drawer opening in my Liquid theme build?

Topic summary

Issue: In a Shopify theme built with Liquid, clicking to view the cart should open a cart drawer (modal) but instead redirects to /cart. The user suspects the click event isn’t being properly prevented (e.g., missing event.preventDefault), so the modal class mini-cart-open is never applied.

Context: The author followed two tutorials and ultimately copied their implementations verbatim with plans to customize later, but the drawer still doesn’t open. “Cart drawer” refers to a slide-in mini-cart overlay; Liquid is Shopify’s templating language.

Assets: A GitHub repository link to relevant snippets was provided for review.

Ask: Help diagnosing why the cart drawer isn’t opening and how to ensure the event is prevented so the modal class is applied.

Status: No solution or concrete troubleshooting steps confirmed yet; issue remains open.

Summarized with AI on January 10. AI used: gpt-5.

I am building a theme with Liquid and I have followed 2 tutorials to open the cart as a drawer (modal), and I can’t get it to work. I think it’s related to the events not being prevented accordingly because I get redirected to ‘/cart’ instead of opening the modal (adding the class ‘mini-cart-open’.

I would appreciate any help.

https://github.com/icarus/Laboratories-Shopify-Theme/tree/master/snippets

I tried following the tutorials accordingly and ended up just literally copying everything so I later modify it to fit my design but it won’t work.