theme-scripts
theme-scripts copied to clipboard
Add custom selectors option. Fix theme-product-form logic
Purpose
The goal of this PR is to add an optional parameter to pass custom selectors to theme-product-form. Currenly, it is always default to fixed selector. This would open allow fix apps issues that happen during same selectors in form. For example, ReCharge that currently broke this lib. This problems also mentioned in issues: https://github.com/Shopify/theme-scripts/issues/135 https://github.com/Shopify/theme-scripts/issues/146
Also id change logic was changed. Many apps depens on id field during initializing as also many of them depens on change event of this field. Logic was rebuild to always change id field, so apps logic will not be corrupt.
Approach
- Add option to pass custom selectors to lib.
- Fix theme-product-form logic for apps like ReCharge.
@NoZiL @martinamarien Please, review this changes