AllenFang / AllenFang/react-bootstrap-dropdown

[Proposal] icon

オープン
#2 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
6
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi @AllenFang,

It would be great to add possibility for setting an icon the current selected item (not visible in the list). My proposal would be:
- add a `iconClass` property into the `item`
- in `DropDown` add a new state `selectedItem` which would be used for rendering the title for button
- add a new optional prop `selectedItem` which would pre-fill the `selectedItem` state
- in `componentDidMount` we would check if `selectedItem` prop is set and will pre-fill the `selectedItem` state , if `title` is provided instead of `selectedItem`, we would build an item with only `text` property.

These changes would add new way how to set and render the button title without breaking old settings.

Do you agree? I can make the changes.

Martin.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。