My form incorporates the Canada Post AddressComplete tool, which functions similarly to Google Maps Autocomplete. As you type your address, suggestions appear in a drop-down menu.
However, after selecting an address, the text in the Postal Code and City fields overlaps with the labels. Interestingly, when using Google Chrome's autofill feature, the data displays correctly in these fields.
For reference, I have included the code for Canada Post AddressComplete below, as well as the HTML for the affected fields.
You can access the form at . Simply choose any amount and proceed to the next page to view the problem fields.
Screenshot: https://i.sstatic.net/gNU2A.png
Despite attempting various solutions, such as utilizing JavaScript code found in similar inquiries, I have not been successful in resolving the issue of overlapping field labels during autofill on Chrome.
Canada Post AddressComplete:
<link rel="stylesheet" type="text/css" href="https://ws1.postescanada-canadapost.ca/css/addresscomplete-2.30.min.css?key=wt22-dj39-nm11-ua29" />
<script type="text/javascript" src="https://ws1.postescanada-canadapost.ca/js/addresscomplete-2.30.min.js?key=wt22-dj39-nm11-ua29"></script>
Postal Code Field HTML:
<div class="mdl-cell mdl-cell--6-col" id="zip_code_container" style="visibility: visible; position: relative;"><div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label is-invalid is-upgraded" data-upgraded=",MaterialTextfield"><input class="mdl-textfield__input" data-id="text" required="" maxlength="10" size="10" type="text" name="donation[zip_code]" id="donation_zip_code" autocomplete="off"><label class="mdl-textfield__label" for="donation_zip_code">Postal Code</label></div></div>
City Field HTML:
<div class="mdl-cell mdl-cell--6-col"><div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label is-invalid is-upgraded is-dirty" data-upgraded=",MaterialTextfield"><input class="mdl-textfield__input" data-id="text" required="required" type="text" name="donation[city]" id="donation_city"><label class="mdl-textfield__label" for="donation_city">City</label></div></div>
I am open to suggestions on how to fix this overlapping issue through JavaScript or CSS modifications, or potentially changing the field labels to help text displayed beneath the fields.
The current form supports help text, but only for additional questions and not existing fields.