From 5489910f2e66fe101b46c1dbc8b593d5f064f233 Mon Sep 17 00:00:00 2001 From: andrelandgraf Date: Wed, 21 Aug 2019 15:41:23 +0200 Subject: [PATCH] merging pull request --- package.json | 2 +- testing/demo-app/src/App.js | 4 ++++ testing/demo-app/src/DataListInput.jsx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 79c2362..8f20200 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/testing/demo-app/src/App.js b/testing/demo-app/src/App.js index 9426d6f..2fc8b7b 100644 --- a/testing/demo-app/src/App.js +++ b/testing/demo-app/src/App.js @@ -34,6 +34,10 @@ function App() { setItem( i )} + placeholder="Select a ingredient" + clearInputOnSelect={false} + suppressReselect={false} + initialValue={item ? item.label : ''} /> diff --git a/testing/demo-app/src/DataListInput.jsx b/testing/demo-app/src/DataListInput.jsx index 956706c..b6c4807 100644 --- a/testing/demo-app/src/DataListInput.jsx +++ b/testing/demo-app/src/DataListInput.jsx @@ -252,7 +252,7 @@ class DataListInput extends React.Component { { item.label.substr( indexOfMatch, currentInput.length ) } - { item.label.substr( currentInput.length, item.label.length ) } + { item.label.substr( indexOfMatch + currentInput.length, item.label.length ) } );