Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
279 stars 77 forks source link

bug(@vtmn/react) `VtmnDropdown` component always display label although it is not configured #1399

Closed jdeca-decat closed 1 year ago

jdeca-decat commented 1 year ago

Describe the bug In the React Showcase of the VtmnDropdown component, it say that if the label is not set, it will not disayed but it's still here

Steps to reproduce

Expected behavior Normally, if the label is not set, it does not appear

Version affected @react: 18.2.0 @vtmn/react: 0.67.0

Screenshot from 2023-03-24 11-30-26 Screenshot from 2023-03-24 11-30-08

jdeca-decat commented 1 year ago

While waiting for the bug to be fixed, I added a style rule: .vtmn-dropdown > label { display: none; }

lauthieb commented 1 year ago

Thanks @jdeca-decat for this issue. As the @vtmn/react is a community library, I hope someone will take this issue to help you. If you want, feel free to contribute also! We are there to help you if needed regarding launching & contributing on the vitamin-web stack.

0x2A-git commented 1 year ago

Hi @jdeca-decat,

Following our last discussion from #1401 I'm glad you've been able to solve your issue.

I've just opened a P.R in order to solve this issue so that we won't have to use a CSS workaround anymore :)

jdeca-decat commented 1 year ago

Thanks @0x2A-git I'll take a look ! But.. I stopped using the VtmnDropdown, because I had another problem: there is no documentation and no option to configure the dropdown in single selection mode. I want to disable multiselect default option but there is no way apparently :(

0x2A-git commented 1 year ago

Thanks @0x2A-git I'll take a look ! But.. I stopped using the VtmnDropdown, because I had another problem: there is no documentation and no option to configure the dropdown in single selection mode. I want to disable multiselect default option but there is no way apparently :(

Did you take a look at the Select component ? It might suit your use case :) ( https://www.decathlon.design/726f8c765/p/46ee45-select/b/97a60e/t/951797 )

jdeca-decat commented 1 year ago

Thanks @0x2A-git I'll take a look ! But.. I stopped using the VtmnDropdown, because I had another problem: there is no documentation and no option to configure the dropdown in single selection mode. I want to disable multiselect default option but there is no way apparently :(

Did you take a look at the Select component ? It might suit your use case :) ( https://www.decathlon.design/726f8c765/p/46ee45-select/b/97a60e/t/951797 )

In fact, I have to respect a mockup given by a ui designer. He wants to use the dropdown rather than the select for aesthetic reasons but I'll tell him to make a deal ! Thanks to you ;)

lauthieb commented 1 year ago

Great idea :) Accessibility + web standards + usage > aesthetic

thibault-mahe commented 1 year ago

Closed by https://github.com/Decathlon/vitamin-web/pull/1405, thanks @0x2A-git !