From 69e28229154982fcd01a0e25bb8c9f83cffb8e77 Mon Sep 17 00:00:00 2001 From: ajenkins-kyr Date: Tue, 7 May 2019 16:09:20 -0400 Subject: [PATCH] Fixes issue with "remove on backspace" (#14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With onKeyUp, the last item gets removed one character too early – it gets removed when there's still one character left in inputValue. This is happening because the last remaining character gets removed during the onKeyDown event, so by the time it gets to the onKeyUp event inputValue is empty, so the item gets removed. But if you check inputValue during the onKeyDown event instead, the last item gets removed at the appropriate time. --- src/ordered-examples/04-multi-select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ordered-examples/04-multi-select.js b/src/ordered-examples/04-multi-select.js index 264cde9..106011d 100644 --- a/src/ordered-examples/04-multi-select.js +++ b/src/ordered-examples/04-multi-select.js @@ -208,7 +208,7 @@ class App extends React.Component {