This seems to be a bug to me, wherein only country is not marked required.
But if you want to mark only some fields required from the address component, you can remove the required
attribute from the lightning-input-address component
in html
file and instead use setCustomValidityForField
method in the JS. You can find the documentation of this method in the lightning-input-address specification
Below code sample shows how to validate only country and state fields
handleSubmit(event) {
event.preventDefault();
const address = this.template.querySelector('lightning-input-address');
//Country Field Validation
var country = address.country;
if (!country) {
address.setCustomValidityForField('Field is Required', 'country');
} else {
address.setCustomValidityForField("", 'country'); //Reset previously set message
}
//State Field Validation
var province = address.province;
if (!province) {
address.setCustomValidityForField('Field is Required', 'province');
} else {
address.setCustomValidityForField("", 'province'); //Reset previously set message
}
address.reportValidity(); // Refreshes the component to show or remove error messages from UI
const isValid = address.checkValidity(); //Check if the address is Valid and accordingly proceed.
}
The only drawback here is, the asterisk sign won't appear. You will have to fiddle with css
a bit to achieve that.