dhlparcel / plugin-magento2-release

DHL Parcel plugin for Magento 2
Open Software License 3.0
9 stars 21 forks source link

The service point popup is displayed on form submit or Enter keydown #56

Closed boldhedgehog closed 1 year ago

boldhedgehog commented 1 year ago

Issue:

Pressing Enter on any input field in the shipping method checkout form "co-shipping-method-form" displays the DHL service point locator popup.

This is caused by the missing type of the #dhlparcel-shipping-servicepoint-button button. Due to the missing button type the button behaves as the form submit button. And pressing Enter in any input field in the form triggers the "click" event added here: https://github.com/dhlparcel/plugin-magento2-release/blob/master/view/frontend/web/js/view/servicepoint-loader.js#L150

The button is defined here: https://github.com/dhlparcel/plugin-magento2-release/blob/master/view/frontend/web/template/servicepoint-info.html#L8

Adding the attribute type="button" solves the issue.

<button id="dhlparcel-shipping-servicepoint-button" type="button"
  data-bind="text: DHLParcel_Shipping_HasServicePoint() ? $t('Choose a different DHL ServicePoint') : $t('Please choose a DHL ServicePoint')">
</button>
roerlemans commented 1 year ago

Thanks for your detailed issue. We will resolve this in our next release (which is planned this Monday).