hyperHTML-Element: Unexpected reflection with boolean attributes
Hi,
I’m trying to initialize a property based on an attribute like:
this.active = this.hasAttribute('active') || null;
It works fine in a vanilla custom element but isn’t working as I expect in a hyperHTML-Element because the property is reflected as attribute, this means this.active
will be always true.
I’m missing something or boolean attributes shouldn’t be reflected in this case?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (12 by maintainers)
OK, latest behaves reasonably smart. The only better way is to introduce non standard behavior but I think this is already an improvement over what standards offer.