Skip to content

Commit

Permalink
disable input entry on single-select with selection
Browse files Browse the repository at this point in the history
  • Loading branch information
mskocik committed Apr 19, 2021
1 parent 56b8260 commit 2ef114c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Svelecte.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@
if (!event.ctrlKey && !['Tab', 'Shift'].includes(event.key) && !$hasDropdownOpened && !isFetchingData) {
$hasDropdownOpened = true;
}
if (!multiple && selectedOptions.length && event.key !== 'Tab') event.preventDefault();
if (!multiple && selectedOptions.size && event.key !== 'Tab') event.preventDefault();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Control.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
export let inputValue;
export let hasFocus;
export let hasDropdownOpened;
export let selectedOptions;
export let selectedOptions; // passed as array
export let isFetchingData;
Expand Down

0 comments on commit 2ef114c

Please sign in to comment.