Capgemini / dcx-react-library

React Library UI/UX agnostic
https://main--6069a6f47f4b9f002171f8e1.chromatic.com
MIT License
113 stars 6 forks source link

FormGroup: need to be able to set items div wrapper/group classname #367

Closed brightpixels closed 1 year ago

brightpixels commented 1 year ago

Describe the bug The FromGroup items are wrapped with a div but there is no option/prop to set the class in this div. I propose a prop called "itemGroupClassName"

To Reproduce Use the FormGroup in a React app and observe the div wrapping the list of radios/checkboxes and attempt to set a class name for this wrapping container

Expected behavior To be able to set a class name on the div wrapping the list of items/radios/checkboxes

Please follow the following instruction to create the new branch:

git checkout release/0.6
git pull
git checkout -b 'feature/form-wrapper-classname'
cg-julian-taylor commented 1 year ago

I believe a property for this already exists.

On the <FormGroup/> component there is a itemClassName prop that is passed down as seen in the image below.

fieldset > div.itemsClasses > div.itemClassName is the one I believe we are trying to resolve.

(I used itemsClasses and itemClassName as classes to help identify which props are being passed).

Screenshot 2022-12-14 at 11 30 00

If I have understood this correctly then there isn't a need for a code change but perhaps renaming the props and adding to documentation may clear up future confusion?

brightpixels commented 1 year ago

@cg-julian-taylor you are right :) We can close this one.