You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 setdisplay
on your templates, it'll overridehidden
.I would argue that it'd be very, very easy for a developer to set
display
on their template without thinking that this could causeiron-list
to function incorrectly.I think by default, the iron-list component should do something like this:
If that's unacceptable, then
iron-list
should just setdisplay: none
when it intends to hide something. I love the idea behind usinghidden
, if it were to work well, but the fact of the matter is, withhidden
being less specific thendisplay
, you create a situation where developers can bite themselves extremely easily. So it doesn't work well at all. Ifhidden
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.
The text was updated successfully, but these errors were encountered: