postcode-nl / PostcodeNl_Api_Magento2

A Magento 2 plugin that implements the Postcode.nl international address API
https://developer.postcode.eu/documentation/
BSD 2-Clause "Simplified" License
10 stars 13 forks source link

How to always show autofill formatted output, also when address is failed #56

Closed JelleGe closed 2 years ago

JelleGe commented 2 years ago

How can we always show the autofill formated output? Even when the address is failed.

We already tried the following in /web/js/form/components/address-autofill-formatted-output.js but that sadly does not work:

        nlAddressStatus: function (status) {
            if (status !== 'valid') {
                this.visible(true);
            }
        },

        renderNlAddress: function (address) {
            if (this.nlAddressStatus !== 'valid') {
                this.visible(true);
                return; // Waiting for house number addition to be selected.
            }

            const line1 = address.street + ' ' + address.houseNumber + (address.houseNumberAddition ? ' ' + address.houseNumberAddition : ''),
                line2 = address.postcode + ' ' + address.city;

            this.content(line1 + ' ' + line2);
            this.visible(true);
        },