0

In order to maintain data integrity, we are trying to implement the lightning-input addresses in show-address-lookup mode. This mode renders a lookup field integrated with google places API, which gets you the address recommendations on change in real-time.

enter image description here

On select, the supporting address fields: Street, City, State, and Province get automatically populated, though still editable.

enter image description here

We need to make these fields non-editable, ensuring that the users are not updating them to arbitrary values, and ensuring the data integrity.

The lightning address input does not allow making these fields read-only (while address input lookup is still usable), and it seems not possible to find these abstracted fields from the lightning address input and modify their class/attributes and disable them via querySelector.

Any help here would be appreciated.

1 Answer 1

0

There is "read-only" attribute on lightning-input-address which you can use. It would still have the address search bar which you can use to search the address, but wouldn't allow the other fields editable. You can read about the "read-only" attribute and other attirbutes here: https://developer.salesforce.com/docs/component-library/bundle/lightning-input-address/specification

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.