fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

ChoiceGroupOption className prop overwrites default styles

Open phkuo opened this issue 8 years ago • 1 comments

When using the className prop of a ChoiceGroupOption, not only does it overwrite the default classes that should be on there, it gets applied to the hidden radio button element, which is not useful.

https://codepen.io/anon/pen/QJyQJZ

Code:

        <ChoiceGroup
          label={ "Example" }
          options={ [
            {
              key: "foo",
              text: "foo",
              imageSrc: "http://placekitten.com/64/64",
              className: 'test0'
            },
            {
              key: "bar",
              text: "bar",
              imageSrc: "http://placekitten.com/64/64",
              className: 'test2'
            }
          ] } />

The result will show the radio button which should be invisible. This is because of this line of code: https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroupOption/ChoiceGroupOption.base.tsx#L61

The className from props overwrites the already-defined className. className should instead be mixed into the root div for maximum flexibility in customization.

(low priority, non-blocking)

phkuo avatar Nov 07 '18 23:11 phkuo

:tada:This issue was addressed in #7031, which has now been successfully released as [email protected].:tada:

Handy Links:

msft-github-bot avatar Nov 09 '18 13:11 msft-github-bot