question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[carbon-react] Input className prop inconsistencies

See original GitHub issue

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Summary

The elements which receive extra classnames one can provide to carbon components vary for the different inputs. This makes it really hard to apply some custom styling to individual input components consistently.

  • For text inputs and textareas, the className gets added to the actual input (or textarea) element
  • In number inputs and the select component, it is added to the outer-most element (.bx--number / .bx--select), where .bx--form-requirement is a child.
  • For Dropdown, ComboBox and MultiSelect the className is added to a wrapper element adjacent to .bx--form-requirement.

Is it planned to make this behaviour consistent and therefore more predictable in v11?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
emyarodcommented, Apr 14, 2020

@janhassel nothing is finalized at the moment but I would say at the very least in 6 months or further down the road

0reactions
vpiconecommented, Jun 4, 2021

If we want to broaden the scope to include events, that might be helpful as well (for ex. should Dropdown pass an event like the other form inputs do)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Guide - Carbon Design System
This guide helps you update your project to Carbon v11. It is broken into sections based on packages that you are using in...
Read more >
Warning: Prop `className` did not match. when using styled ...
It looks like the className prop that is being set on your component is not the same when the component is rendered on...
Read more >
How to Create and Validate Forms in React using Formik and ...
In this tutorial, you'll learn how creating and validating forms can be simpler in React using Formik and Yup.
Read more >
Carbon v11 Beta 2. The second public beta for v11 - Medium
The className prop is available in almost every component that we ship today. ... Icon components are now available in @carbon/react.
Read more >
Building a design system with Radix - LogRocket Blog
The guide shows how to use Radix to develop a basic React component ... Root className="rootSlider" value={props.value}> <SliderPrimitive.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found