mirror of
https://github.com/danog/react-datalist-input.git
synced 2024-12-11 17:09:39 +01:00
merging pull request
This commit is contained in:
parent
9f69dc86ee
commit
5489910f2e
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-datalist-input",
|
||||
"version": "1.2.8",
|
||||
"version": "1.2.9",
|
||||
"description": "This package provides a react component as follows: an input field with a drop down menu to pick a possible option based on the current input.",
|
||||
"main": "./lib/DataListInput.js",
|
||||
"license": "MIT",
|
||||
|
@ -34,6 +34,10 @@ function App() {
|
||||
<DataListInput
|
||||
items={data}
|
||||
onSelect={i => setItem( i )}
|
||||
placeholder="Select a ingredient"
|
||||
clearInputOnSelect={false}
|
||||
suppressReselect={false}
|
||||
initialValue={item ? item.label : ''}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -252,7 +252,7 @@ class DataListInput extends React.Component {
|
||||
<strong>
|
||||
{ item.label.substr( indexOfMatch, currentInput.length ) }
|
||||
</strong>
|
||||
{ item.label.substr( currentInput.length, item.label.length ) }
|
||||
{ item.label.substr( indexOfMatch + currentInput.length, item.label.length ) }
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user