react-tag-autosuggest-dropdown-menu
A tagging component that has an autosuggest dropdown menu that highlights the matching characters.
Installation
npm install react-tag-autosuggest-dropdown-menu --save
or
yarn add react-tag-autosuggest-dropdown-menu
Usage
{ super thisstate = chosenValue: '' searchValue: '' showDropdown: false list: id: 1 valueToSearch: "Wezi Amanda" id: 2 valueToSearch: "Mikayu Chindongo" id: 3 valueToSearch: "Suzuki Kelvin Mwila" id: 4 valueToSearch: "Maya Thundu" id: 5 valueToSearch: "Tinta Mwila" id: 6 valueToSearch: "Franco Lubinda" id: 7 valueToSearch: "Tchalla Brown" id: 8 valueToSearch: "Chanda Rose Mwila" chosenItems: thischooseDropdownItem = thischooseDropdownItem thisupdateSearchValue = thisupdateSearchValue thisshowDropdown = thisshowDropdown thisdetectBackSpace = thisdetectBackSpace thisremoveTag = thisremoveTag } { e this } { e if ekeyCode === 8 && thisstatesearchValue === '' && thisstatechosenItemslength > 0 // backspace key has been hit let chosenItems = thisstatechosenItems chosenItems this } { e const tags = thisstatechosenItems this } { e this } { this } { return <div className='App'> <ReactTagAutoSuggestDropdown list=thisstatelist showDropdown=thisshowDropdown displayDropdownMenu=thisstateshowDropdown chosenValue=thisstatechosenValue chooseDropdownItem=thischooseDropdownItem updateSearchValue=thisupdateSearchValue searchValue=thisstatesearchValue highlightColour="#ff9966" chosenItems=thisstatechosenItems detectBackSpace=thisdetectBackSpace removeTag=thisremoveTag /> </div> ; } ;
ReactTagAutoSuggestDropdown props
Props | Default values | Possible values |
---|---|---|
list | none | array |
chosenItems | none | array |
showDropdown | none | function |
displayDropdownMenu | false | bool |
chosenValue | none | any |
searchValue | none | any |
chooseDropdownItem | none | function |
updateSearchValue | none | function |
detectBackSpace | none | function |
removeTag | none | function |
highlightColour | "#00cc99" | string |