Skip to content

RadioButton Custom Icon not passed theme as a prop #6263

@gfargo

Description

@gfargo

Expected Behavior

Similar to the custom checked icon within the CheckBox component, the StyleRadioButtonIcon should be passed the theme as a prop here.

The ThemeType type should likely also match the any value being used by checkBox.icons.checked.

Actual Behavior

Instead there is both a type error within ThemeType & type error when trying to pass a custom icon via radioButton.icons.circle due to icon being undefined.

URL, screen shot, or Codepen exhibiting the issue

Screen Shot 2022-08-06 at 5 31 33 PM

Demo of issue

Steps to Reproduce

  1. Create custom theme for radioButton.icons.circle that includes a grommet icon, like you would for checkBox.icons.checked

e.g.

// Works 🎉 
checkBox: {
  icons: {
    checked: Gremlin,
  }
},

// Doesn't work 😢 
radioButton: {
  icons: {
    circle: Gremlin,
  }
}  
  1. Pass theme to any component trying to render the grommet RadioButton component.

Your Environment

  • Grommet version: 2.25.1
  • Browser Name and version: Chrome Version 103.0.5060.134 (Official Build) (arm64)
  • Operating System and version (desktop or mobile): Desktop - MacOS 12.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    in progressCurrently in development

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions