Skip to content

Boolean attribute behavior confusing #78

Open
@sunesimonsen

Description

@sunesimonsen

The current boolean attribute behavior might be intentional, but I find it really confusing that something that is used a string attribute turns into a boolean attribute when the value is an empty string:

boolean attribute

It could be that I just need to use some other mechanism that I don't know about. But I just wanted to say that I found this behavior surprising.

I would still expect an attribute without any value to be true and a missing attribute to be undefined when retrieving the value.

The code that is doing this conversion can be found here:
https://github.com/matthewp/haunted/blob/master/src/component.js#L34

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions