fetchify-dev / magento2

Fetchify Magento 2 Integration
https://fetchify.com
3 stars 6 forks source link

Form controls do not use Magento CSS classes #8

Closed JacobDrummond closed 6 years ago

JacobDrummond commented 6 years ago

Environment

Replication steps

  1. Style checkout forms using Magento's built-in classes
  2. Load guest checkout

Expected result

Actual result

Cause

Solution

Here's my temporary composer patch:

--- view/frontend/web/form_integrations/cc_customer_address.js  Tue Nov 28 10:45:02 2017
+++ view/frontend/web/form_integrations/cc_customer_address.js  Tue Nov 28 13:41:25 2017
@@ -12,7 +12,7 @@
            }
            var tmp_html = '<div class="field"'+custom_id+'><label class="label">' +
                            c2a_config.texts.search_label+'</label>' +
-                           '<div class="value"><input id="cc_'+cc_index+'_search_input" type="text"/></div></div>';
+                           '<div class="control"><input id="cc_'+cc_index+'_search_input" type="text"/></div></div>';

            form.find('#street_1').closest('.field').before( tmp_html );

--- view/frontend/web/form_integrations/cc_default_checkout.js  Tue Nov 28 10:45:02 2017
+++ view/frontend/web/form_integrations/cc_default_checkout.js  Tue Nov 28 13:41:25 2017
@@ -12,7 +12,7 @@

            var tmp_html = '<div class="field"'+custom_id+'><label class="label">' +
                            c2a_config.texts.search_label+'</label>' +
-                           '<div class="value"><input id="cc_'+cc_index+'_search_input" type="text"/></div></div>';
+                           '<div class="control"><input id="cc_'+cc_index+'_search_input" type="text"/></div></div>';
            form.find('[name="street[0]"]').closest('fieldset').before( tmp_html );

            var dom = {
GaborSuranyi commented 6 years ago

Thanks for reporting this. With the default Luma template this issue isn't visible, as .control has the same value for the .value field (which was the standard at the release of M2) But I looked into the layout, and I can see that it does use .control now. I'll patch it to ensure compatibility with themes.