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` onChange is not working #1377

Closed JulienGaudet closed 1 year ago

JulienGaudet commented 1 year ago

Hi,

It seems that the onChange method for the VtmnDropDown doesn't work at all ?

I've took the original sample from the Decathlon design website and nothing happen when we change the values....

Any ideas ?

lauthieb commented 1 year ago

Hello @JulienGaudet,

Thanks for your request.

Can you please give us more detail regarding the implementation (React, Svelte or Vue) and version? For your information, as written in our README, React, Svelte & Vue libraries are maintained by the community as we don't have any budget to maintain them, unfortunately... But we can accompany you in making a Pull Request or connect you with contributors.

CleanShot 2023-02-24 at 15 22 59@2x

Thanks for your help.

https://github.com/Decathlon/vitamin-web/blob/main/CONTRIBUTING.md

JulienGaudet commented 1 year ago

Hello @lauthieb,

Of course, we use the package : "@vtmn/react": "0.54.3"

And for the implementation, we've litteraly copy and paste the code from : https://www.decathlon.design/726f8c765/v/0/p/42d824-dropdown/b/28931f

And nothing happen on the onChange method. We've managed to make the component work by using onClick method on each VtmnDropDownItem, but I don't think that is the right way to do it.

I have several components that I could integrate at @vtmn/react such as DatePicker, DateRange, Table...

But unfortunately I do not have the time to add it properly to the package for now. Maybe in a few month when our product will be in a stable version.

Have a nice day :)

0x2A-git commented 1 year ago

Hi @JulienGaudet,

You're right from what I understood the only way to handle onChange events is by passing an onChange handler for each child of VtmnDropdown.

I've made a pull request in order to be able to pass an onChange prop directly in the VtmnDropdown.

Have a nice day :smile: