salesforce/lwc

[SSR] `engine-server` doesn't handle undefined/null for `aria*` reflection the same as the browser

nolanlawson opened this issue · 0 comments

connectedCallback() {
  this.ariaLabel = undefined
  this.ariaLabel = null
  this.ariaLabelledBy = undefined
  this.ariaLabelledBy = null
}

Currently in the browser we handle undefined/null both as removing the attribute (which is correct), except for the nonstandard ariaLabelledBy property where we only treat null this way. (Setting undefined results in the string "undefined".)

In the server, we do not distinguish between standard (e.g. ariaLabel) and nonstandard (e.g. ariaLabelledBy) props, so there is a discrepancy between the server behavior and browser behavior. We should probably make the server consistent with the browser since the browser is based on @lwc/aria-reflection which is heavily biased towards backwards compatibility rather than correctness.