Skip to content

Race condition when animating Ajax Cart after item added #2

Answered by james0r
james0r asked this question in Q&A
Discussion options

You must be logged in to vote

Edit: Solved
There were a couple issues at play here, one being that i was losing applied classes to the cart that was being swapped out by liquid ajax cart. The solution to this was to move my root level Alpine.js revealed ajax cart to a wrapper wrapping the root of LAC.

Then I faced the issue with LAC wanting to be the root element of the section so I ended up moving my Alpine.js ajax cart root into theme.liquid and wrapping my {% section 'minicart' %} in the Alpine.js ajax cart root.

Looks like this:

  <div 
      class="minicart-wrapper"
      x-data 
      x-show="$store.globals.minicartIsShowing" 
      x-on:click.outside="$store.globals.minicartIsShowing = false"
      x-transition…

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@james0r
Comment options

@EvgeniyMukhamedjanov
Comment options

@EvgeniyMukhamedjanov
Comment options

@EvgeniyMukhamedjanov
Comment options

@EvgeniyMukhamedjanov
Comment options

Answer selected by james0r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants