mirror of
https://github.com/danog/react-datalist-input.git
synced 2024-12-12 09:29:56 +01:00
merging pull request
This commit is contained in:
parent
9f69dc86ee
commit
5489910f2e
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-datalist-input",
|
"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.",
|
"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",
|
"main": "./lib/DataListInput.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -34,6 +34,10 @@ function App() {
|
|||||||
<DataListInput
|
<DataListInput
|
||||||
items={data}
|
items={data}
|
||||||
onSelect={i => setItem( i )}
|
onSelect={i => setItem( i )}
|
||||||
|
placeholder="Select a ingredient"
|
||||||
|
clearInputOnSelect={false}
|
||||||
|
suppressReselect={false}
|
||||||
|
initialValue={item ? item.label : ''}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -252,7 +252,7 @@ class DataListInput extends React.Component {
|
|||||||
<strong>
|
<strong>
|
||||||
{ item.label.substr( indexOfMatch, currentInput.length ) }
|
{ item.label.substr( indexOfMatch, currentInput.length ) }
|
||||||
</strong>
|
</strong>
|
||||||
{ item.label.substr( currentInput.length, item.label.length ) }
|
{ item.label.substr( indexOfMatch + currentInput.length, item.label.length ) }
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user