Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some kind of warning about the hidden attribute, or use display none #515

Open
srcrip opened this issue Mar 26, 2018 · 0 comments
Open

Comments

@srcrip
Copy link

srcrip commented Mar 26, 2018

I recently got bitten by the hidden attribute when working with an iron-list, pretty bad. I'm much more of a back end developer, but I still try to do as much front end as I can.

Being one who has much less experience with front end work, hidden was news to me. I found this link explaining that it has very low specificity, so if you set display on your templates, it'll override hidden.

I would argue that it'd be very, very easy for a developer to set display on their template without thinking that this could cause iron-list to function incorrectly.

I think by default, the iron-list component should do something like this:

[hidden] { display: none !important}

If that's unacceptable, then iron-list should just set display: none when it intends to hide something. I love the idea behind using hidden, if it were to work well, but the fact of the matter is, with hidden being less specific then display, you create a situation where developers can bite themselves extremely easily. So it doesn't work well at all. If hidden isn't a realistic choice then it's not a good choice, when there's a perfectly acceptable better choice available.

If either of those choices are unacceptable I think there needs to be some sort of warning about this either on Github or the web components website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant