tbranyen/diffhtml

boolean attributes get non-empty string values repeating the attribute name: attr="attr"

CetinSert opened this issue · 4 comments

After

innerHTML(target, `<video controls></video>`)

expected DOM state:

<video controls></video>

got:

<video controls="controls"></video>

  1. Is there a reason why this is the case?
  2. Is there a way to get the expected output?
    1. if no, can this be addressed as a bug to fix?
    2. or at the very least handled via a config option?

This is due to interpolation and how we don't differentiate between the following:

const controls = 'controls';

html`<video ${controls} />`

and

const controls = 'controls';

html`<video controls=${controls} />``

That said it can and should be fixed. Thanks for opening!

Opened a fix here: #243

@tbranyen – thank you very much for the immediate response! When is the next release scheduled?

Just published as 1.0.0-beta.22