AllenFang / AllenFang/react-bootstrap-dropdown

[Proposal] icon

Aberta
#2 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
JavaScript
Estrelas
6
Forks
2
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.