mirror of
https://github.com/danog/react-datalist-input.git
synced 2024-12-03 09:57:50 +01:00
max input length now works with default match function on input click
This commit is contained in:
parent
0e4e12eb05
commit
cdfa4c5124
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-datalist-input",
|
||||
"version": "1.1.26",
|
||||
"version": "1.1.27",
|
||||
"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",
|
||||
|
@ -74,7 +74,7 @@ class DataListInput extends React.Component {
|
||||
const currentInputIsLastItem =
|
||||
!clearInputOnSelect && lastValidItem && lastValidItem.label === currentInput;
|
||||
const displayableItems = matchingItems.length && !currentInputIsLastItem
|
||||
? matchingItems : items.slice( 0, dropDownLength );
|
||||
? matchingItems.slice( 0, dropDownLength ) : items.slice( 0, dropDownLength );
|
||||
|
||||
let index = lastValidItem && !clearInputOnSelect
|
||||
? this.indexOfItem( lastValidItem, displayableItems ) : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user