Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update components to place className on outer node #9465

Closed
1 task
Tracked by #9356
joshblack opened this issue Aug 11, 2021 · 1 comment · Fixed by #9502
Closed
1 task
Tracked by #9356

Update components to place className on outer node #9465

joshblack opened this issue Aug 11, 2021 · 1 comment · Fixed by #9502
Assignees

Comments

@joshblack
Copy link
Contributor

joshblack commented Aug 11, 2021

We currently inconsistently place className for our components. In v11, we will have each component place the className prop on the outermost node. This issue is for updating components in a non-breaking way using the useFeatureFlag hook to place the className prop on the outermost node.

function Demo() {
  const enabled = useFeatureFlag('enable-v11-release');

  // Figure out common pattern for placing `className` on outermost node
}

This issue is for filling out the list below of components that currently place className on the outermost node and for addressing this using the pattern described above.

A list of components that place className on the outermost node:

  • TODO
@joshblack joshblack changed the title Update components to place on outer node Update components to place className on outer node Aug 11, 2021
@tw15egan
Copy link
Member

tw15egan commented Aug 17, 2021

Components that do not place className on the outermost node:

  • Checkbox (also wrapped in bx--form-item, but it is wrapping two adjacent elements)
  • Combobox / Dropdown / Multiselect (Should all be fixed via Listbox)
  • DatePicker (wrapped in bx--form-item)
  • NumberInput (wrapped in bx--form-item)
  • RadioButtonGroup (wrapped in bx--form-item)
  • Slider (also wrapped in bx--form-item, but it is wrapping two adjacent elements)
  • TimePicker (also wrapped in bx--form-item, but it is wrapping adjacent elements)

@andreancardona

  • Select (wrapped in bx--form-item)
  • TextArea (also wrapped in bx--form-item, but it is wrapping adjacent elements)
  • TextInput (also wrapped in bx--form-item, but it is wrapping adjacent elements)

This seems to be all components that do not allow a user to add a className to the top-level element. In the case of DatePicker, NumberInput, RadioButtonGroup, and Select, it may be best to add the className to bx--form-item, and move the others noted with bx-form-item to also add classes to this outermost wrapper for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants