Props to show hide labels#68
Conversation
|
Thanks for your work! However, I think hiding/showing labels should be done using CSS instead. Can you achieve the same result using CSS? |
|
@davidchin Good question, theoretically you can but with two drawbacks.
Thoughts? |
|
Hey @oyeanuj, thanks for your reply! Few good points there. However, I still think controlling the visual appearance of a component should be done using CSS. I'm saying this because, if the visibility of every child element can be controlled using props, then I have to introduce a lot of boolean flags, not only the ones you've added in this PR. I want to avoid that if possible. If you want to hide certain labels based on the model value, perhaps you can set a One thing I haven't done is that if |
|
@davidchin Thanks for the reply. So would you accept a PR that makes the following change?
|
|
Can we please have an example CSS to hide the labels? Thank you! |
|
Here is my solution to the problem, using formatLabel prop: |
Hi @davidchin! Another PR, this time to make the showing or hiding of labels configurable. It is in the same vein as #24 but with more granular controls and on the refactored code base.
Hope this helps!
Thank you!