alexkuz/react-input-enhancements

Full width dropdown popup

pmendelski opened this issue · 4 comments

Hi, is there an easy way to make dropdown popup full width?

To be exact I would like to add rule width: 100% to popup--jss-0-5 class but I know it's a bad idea to add css rules to a generated class name.

I hacked it with:

const onRenderList = (className, style = {}, ...args) =>
  Dropdown.defaultProps.onRenderList(className, { ...style, width: '100%' }, ...args);

...but it is far from perfection ;)

@mendlik Dropdown is now configurable via theme prop, it goes like this:

{
  inputEnhancementsPopup: ({ style }) => ({
    style: {
      ...style,
      width: '100%'
    }
  })
}

Sorry my answer took so long :)

Thanks

Can you pass the example for Combobox?
ok, i find how:

<Combobox
  theme={{
    inputEnhancementsPopup: ({ style }) => ({
      style: {
        ...style,
        width: '100%'
      }
    })
  }}
/>