2016-10-28 4 views
1

enter image description hereReact-Selectでは、React-Bootstrap-Glyphiconからドロップダウンにアクセスできるようにするにはどうすればよいですか?私は-選択を反応させるのが、代わりにUIの本のように見える使用してドロップダウンを作成したい

は、私はそれが次のようになりたいと思った:

enter image description here

これは私の現在のコードです:

dropDown = R.createElement(Select, { 
      options: options, 
      valueKey: 'value', 
      labelKey: 'name', 
      clearable: false, 
      placeholder: "Action", 
      searchable: false, 
      autosize: false, 
      onChange: function (opt) { 
       if (opt.callback === undefined && opt.callback !== "function") { return; } 
       opt.callback({ 
        importable: importable, 
        scheduledImportable: sImportable 
       }, index); 
      }, 
      optionRenderer: function (ele) { 
       return R.createElement(
          'span', 
          { style: { color: ele.color} }, 
          R.createElement('span', { className: ele.icon},null, " "), 
          ele.name 
         ); 
      } 
     }); 

ご協力いただければ幸いです。

答えて

0

他の要素を使用しても問題ありませんか?

.select-wrapper { 
    position:relative; 
} 

.select-wrapper .glyphicon { 
    position: absolute; 
    z-index: 5; 
    display: block; 
    top: 7px; 
    left: 10px; 
    color: #ccc; 
    pointer-events: none; 
} 
CSSその後
<div className="select-wrapper"> 
    <span className="glyphicon glyphicon-align-left" aria-hidden="true"></span> 
    <Select .... /> 
</div> 

関連する問題