fix: selecting items with shift + click adds 1st item as dup

(fixes streetwriters/notesnook#398)
This commit is contained in:
thecodrr
2022-03-14 12:50:02 +05:00
parent 9d04d4f48c
commit 16a552c12f
2 changed files with 1 additions and 2 deletions

View File

@@ -135,7 +135,6 @@ function Autosuggest({
const text = getInputValue();
const isFocused = document.activeElement === inputRef.current;
if (isFocused && !text) setFiltered(defaultItems);
console.log(isFocused, text);
}, [defaultItems, getInputValue]);
useEffect(() => {

View File

@@ -66,7 +66,7 @@ function ListContainer(props) {
if (isNaN(endIndex)) return;
setSelectedItems([
...selectionStore.get().selectedItems,
...items.slice(focusedItemIndex.current, endIndex + 1),
...items.slice(focusedItemIndex.current + 1, endIndex + 1),
]);
listItem.firstElementChild.focus();
}