open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
36 stars 26 forks source link

Update street and city fields when (bag) service retrurns a valid response. #3748

Open LaurensBurger opened 10 months ago

LaurensBurger commented 10 months ago

Thema / Theme

Frontend

Omschrijving / Description

Scenario: User provides valid postcode and house number, but notices they made a mistake. User then proceeds to correct the mistake. Streetname and City will not update because they contain data, and this is the condition that is used to prevent a new query.

As a user i expect when i change is postcode and house number to update street and city fields automatically, because this is what i experienced the first time i entered these fields. This should only occur when/if the (bag) service returns valid street & city data to prevent the "removing" of previous entered data in these fields as described in:

1717

Aanvullende opmerkingen / Additional context

We could also inform the user if a location plugin is active and service does not return a street and city. provide them a trigger to empty the fields (street/city)

sergei-maertens commented 10 months ago

This issue has a long history and we are aware that we need more control about the behaviour.

Currently, autofill only overwrites existing/filled data if the fields are marked as read-only.

Technically with the current renderer, we can not tell the difference between data that was entered via the autofill or by a manual action of the user, so we can not apply a heuristic "update the fields unless the user manually changed the values".

Related issues: #1832, #1717, #2566

There is potential to further develop our new addressNL plugin with this behaviour, which addresses your comment.