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

Cannot add class to MultiSelect #1064

Open
TheophileMot opened this issue Feb 2, 2022 · 2 comments
Open

Cannot add class to MultiSelect #1064

TheophileMot opened this issue Feb 2, 2022 · 2 comments
Labels
v11 Carbon v11 feature

Comments

@TheophileMot
Copy link

I would like to add a custom class to a MultiSelect component, thus:

<MultiSelect
  class="asdf"
  ...
/>

When I do so, however, the class does not show up in the DOM.

@metonym
Copy link
Collaborator

metonym commented Feb 9, 2022

More generally, this demonstrates the following inconsistent behavior in this library:

  • for some components, $$restProps is forwarded to the top most element
  • other components pass $$restProps to the "most significant" element (i.e., a nested input)
    • the workaround is to then define ad hoc props like "modalClass" to pass to specific elements

@metonym metonym added the v11 Carbon v11 feature label Jan 9, 2023
@metonym
Copy link
Collaborator

metonym commented Jan 9, 2023

I'm just making a note here about the component API design for v1.

I believe Carbon v11 now always forwards "rest props" to the top-most elements for consistency. We should also consider a consistent practice, and defining additional objects for sub-element props (e.g., inner modal, inputs).

CC @theetrain

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

No branches or pull requests

2 participants