moroshko / react-autosuggest

WAI-ARIA compliant React autosuggest component
http://react-autosuggest.js.org
MIT License
5.97k stars 587 forks source link

Can't style react-autosuggest__container since it doesn't pass className prop #535

Open Fralleee opened 6 years ago

Fralleee commented 6 years ago

Since the container/root element does not pass className prop we can't use styled components on it. Since we're not using any other styling other than styled in our project there is no way for me to set position relative on the root element.

jpggvilaca commented 6 years ago

I think you can get that to work, please check: https://github.com/moroshko/react-autosuggest#theme-optional

I was able to do with CSS Modules. Should be the same with styled components.

luizrrodrigues commented 6 years ago

I think if allow add a custom className to root element, will help a lot.

dayze commented 5 years ago

You can also wrap AutoSuggest in a StyledWrapper ex:

<StyledWrapper>
  <Autosuggest {...yourProps} />
</StyledWrapper>

const StyledWrapper = styled.div`
 & .react-autosuggest__container{
  // your style
  }
`
vikas-chhabra commented 4 years ago

You can also wrap AutoSuggest in a StyledWrapper ex:

<StyledWrapper>
  <Autosuggest {...yourProps} />
</StyledWrapper>

const StyledWrapper = styled.div`
 & .react-autosuggest__container{
  // your style
  }
`

What is styled here??

ethangclark commented 4 years ago

What is styled here??

Google styled-components

dhanraj07 commented 4 years ago

I face a similar issue to customize aria attributes of the container. Is there any way to manage aria attributes of container?