Skip to content

Commit

Permalink
Bug #54870: Fix compatibility with PostNL/MyParcel plugin
Browse files Browse the repository at this point in the history
Check that input is present before triggering change event
  • Loading branch information
JozefVerhoef committed Mar 8, 2022
1 parent 9bf26a5 commit 9006fca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/postcode-eu-autofill.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
{
const addressPart = PostcodeNlAddressFieldMapping.mapping[key];

if (mappedValues.has(addressPart))
if (mappedValues.has(addressPart) && addressFields[key].length > 0)
{
const field = addressFields[key].val(mappedValues.get(addressPart))[0];
field.dispatchEvent(new Event('change'));
Expand Down

0 comments on commit 9006fca

Please sign in to comment.