Open nolanlawson opened 2 weeks ago
Is this specific to ARIA attributes? All of them, standard, or non-standard? Does it impact regular attributes, global HTML attributes, @api attributes?
Is this specific to ARIA attributes?
Dunno. Worth testing HTML global attributes and data-foo
as well.
All of them, standard, or non-standard?
In this case the attributes are purely being used as attributes, so "standard vs nonstandard" doesn't apply. E.g. we have aria-labelledby
here as an attribute, not our nonstandard ariaLabelledBy
property.
@api
This would be another good thing to add tests for. I don't believe it should matter, but you never know.
BTW this is not terribly important because, unless you have an element with id="undefined"
or id="null"
somewhere, then the effective difference between rendering aria-labelledby="undefined"
and not rendering it at all is zero.
As demonstrated in https://github.com/salesforce/lwc/pull/4787, if
dynamic
isundefined
, then this renders (inengine-server
):And for
null
:This is inconsistent at best and wrong at worst. We should probably omit the attribute in both cases.