I have a bit of a tricky one that I hope is something I'm overlooking.
Background info:
- LWC to assign various permissions with comment and dropdown for change type (this works fine)
- modal pops up to show the changes and allow user to double check their changes (this works fine)
Relevant screenshots...
Perm Modal showing required values missing:

Issue:
- when the
changeCommentandchangeReasonare passed into the modal,slds-has-errorclass displays appropriately based on whether the variable is populated. This is correct. - when
Saveis pressed,changeReasondropdown shows the appropriate error,changeCommentlightning-input box does not. This occurs whetherchangeReasonis populated or not.
Relevant screenshots...
Post-save when neither is selected:

Pre-save when changeReason is selected:

Post-save when changeReason is selected:

Relevant chunks of code...
html:
<div class="slds-grid slds-gutters slds-p-around_medium">
<div class="slds-col slds-size_1-of-2">
<lightning-combobox
label="Reason for Change"
placeholder="Select Reason for Change..."
value={changeReason}
options={options}
class={reasonPopulatedClass}
required
disabled
></lightning-combobox>
</div>
<div class="slds-col slds-size_1-of-2">
<lightning-input
data-id="change-comment"
type="text"
value={changeComment}
label="Describe Reason for Change..."
class={commentPopulatedClass}
required
disabled
></lightning-input>
</div>
</div>
js:
if(!this.changeReason) {
const reasonForChange = this.template.querySelector('lightning-combobox');
reasonForChange.setCustomValidity('Please return to the previous page and select a reason for the selected change.');
reasonForChange.reportValidity();
}
if(this.changeComment == '') {
const commentForChange = this.template.querySelector('lightning-input[data-id="change-comment"]');
console.log(commentForChange.value);
console.log(commentForChange.validity);
commentForChange.setCustomValidity('Please return to the previous page and select a reason for the selected change.');
commentForChange.reportValidity();
}
Note on the console logs:
commentForChange.valueandcommentForChange.validityboth show values (empty string and 'true', respectively), although the 'true' is not accurate as it's an empty string, and it is a required field. I've also tried setting a minimum char length to no avail.- I had to play around with my selector for the
changeCommentlightning-input box, as it wasn't playing nice, but thevalueandvalidityproperties illustrate that it is selecting the appropriate DOM element. - right now the
setCustomValidityfunctions are copy-paste of each other to make sure I'm not catching myself with a missed capitalization.
Important note for the reasoning behind this structure:
- unable to use events in modal due to being unable to enable Lightning Web Security due to organization security requirements (lots of testing needed before we can turn it on, not worth it for one LWC at this juncture).
Ask: I've seen rumblings of this not working well for lightning-input on SE and SO, but hoping another set of eyes might see something I'm not. Any ideas?

