liferay / clay

A web implementation of the Lexicon Experience Language
http://clayui.com
Other
208 stars 467 forks source link

fix(@clayui/core): fixes bug when switching column visibility #5776

Closed matuzalemsteles closed 4 months ago

matuzalemsteles commented 4 months ago

Ticket LPD-19431

ethib137 commented 4 months ago

Hey @matuzalemsteles once you select a column to be visible it's rendering it correctly, but the default state is still wrong. When all the columns are shown, they should all be toggled on.

Screenshot 2024-03-05 at 3 53 20 PM Screenshot 2024-03-05 at 3 55 29 PM
matuzalemsteles commented 4 months ago

@ethib137 Oh thank you so that wasn't very clear to me..

matuzalemsteles commented 4 months ago

@ethib137 It looks good now, I fixed a bug in the disabled state behavior too, everything was reversed. Let me know if I missed anything.

matuzalemsteles commented 4 months ago

I was expecting you to use hidden for everything NOT visible. But I'm assuming that when you were writing the code this way made more sense, so I trust your judgement

Oh yes, I tried using hidden for everything but it seemed strange due to the behavior we have to start with all items in the object that are visible so that the checkbox state works correctly when the user unchecks it, so as not to create too much logic on top of that, so that hidden is empty and some extra conditionals in the checkbox so that it is inverted internally, I preferred to go with visible to just make the component logic easier.