Hi,
What does your “add to cart” function look like? It looks like your JS is trying to update the form element with the “data-variant-id” attribute from the size buttons, but what happens after the add to cart event we can’t see.
Is it reading from that attribute of the form to see what variant to add, or is maybe looking at the ATC button attributes instead? If it is targeting the form attribute, are you sure that is being set correctly on variant click? What is that variantInput change event being used for?
These are some questions that should steer you in the right direction - hope it helps!
Don