如何为react-widget DropdownList添加css?

时间:2018-02-02 08:17:03

标签: javascript html css reactjs

我需要从react-widget下拉列表中删除边框。

我尝试了什么;

HTML

<DropdownList
  data={this.props.create.repos}
  textField='key'
  placeholder={placeholder}
  className='dropdown_customized'
  onChange={this.props.save.bind(this, scenarioIndex, stepIndex, placeholder)}
  groupBy='name'
  filter='contains'
/>

CSS

.dropdown_customized {
    max-width: 200px !important;
    border: none !important;
}

但是因为它在DropdownList之外创建了一个div,所以样式没有得到应用。

任何人都知道如何解决这个问题?

更新

displayInputBox函数返回DropdownList ..

<div className="flex-container">
   <span className="blueTag"> &emsp;&emsp; {step.stepOne} </span>
   <div className="divider" />
   {this.displayInputBox(this, step.stepTwo, step.stepId, item.scenarioId)}
</div>

   .flex-container {
      display: flex;
      align-items: stretch;
   }

enter image description here

1 个答案:

答案 0 :(得分:2)

您可以尝试使用DropdownList类

.rw-widget-container{
    border: none;
}