WC-Local-Pickup / woocommerce-local-pickup-time

Adds an option to the WooCommerce checkout pages for Local Pickup that allows the user to choose a pickup time.
https://wordpress.org/plugins/woocommerce-local-pickup-time-select/
29 stars 17 forks source link

fix(checkout): Duplicate HTML id attribute on time select output #204

Closed bmenant closed 1 year ago

bmenant commented 1 year ago

All Submissions:

Changes proposed in this Pull Request:

Appends _wrapper to the id attribute of the <div> element of the public view/form.

Fixes a regression introduced in 1.4.0 where both the <select> and the <div> elements took the same value local_pickup_time_select returned from get_order_post_key() .

Prior to 1.4.0, the <div> element was identified with this hard-coded value: local-pickup-time-select using dashes instead of underscores (https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/blob/1.3.13/public/class-local-pickup-time.php#L692).

This duplicate html id has caused various issues with custom client-side logic around the local pickup field and comes with accessibility issues (since the for attribute of <label> element does not link to the field element anymore on some/all (?) browsers).

Other information:

Changelog entry

bmenant commented 1 year ago

Here you can see the duplicate html id (v1.4.2) this PR addresses: duplicate_ids

timnolte commented 1 year ago

@bmenant thanks for flagging this. I'm going to accept this as-is but I think I'm going to address the fact that I incorrectly changed out id/class values with underscores instead of dashes.