Im not sure if this is a bug, or it's me being silly. What I'm trying to achieve is in the checkout and on an input is the following:
aria-invalid="null"
However what I've noticed is on initial load of the checkout every input on the page loads the
aria-invalid="false"
This can be seen here:
The ticks indicate that the value is set to false, however there isn't any content inside of these items.
What I want is, the value to actually return null on first load, and then use the Ko.observable to say if it should be:
True - there is an error ( its empty )
False - everything is okay
I've had a nosey around and found that the file sits here:
/vendor/magento/module-ui/view/frontend/web/templates/form/element/input.html
And returns the following:
<input class="input-text" type="text" data-bind="
value: value,
valueUpdate: 'keyup',
hasFocus: focused,
attr: {
name: inputName,
placeholder: placeholder,
'aria-describedby': getDescriptionId(),
'aria-required': required,
'aria-invalid': error() ? true : 'false',
id: uid,
disabled: disabled
}" />
I've gotten to this stage and tried to find the even/function for " error() " but I've gotten lost in the rabbit hole.
If anyone has any advice on this, that'd be awesome.