diff --git a/src/App.jsx b/src/App.jsx
index f0b5bd6..e1060c0 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -18,6 +18,7 @@ const App = () => {
noItemsMessage={'No matching fruit found'}
placeholder={'Type something fruity'}
styles={styles}
+ minQueryLength={1}
/>
)
}
diff --git a/src/data.js b/src/data.js
index 69ef8c1..7601ecb 100644
--- a/src/data.js
+++ b/src/data.js
@@ -7,10 +7,11 @@ const fruits = [
"Blackberry",
"Blackcurrant",
"Blueberry",
- "Currant",
+ "Cantaloupe",
"Cherry",
"Cherimoya",
"Clementine",
+ "Currant",
"Date",
"Damson",
"Durian",
@@ -21,6 +22,7 @@ const fruits = [
"Grape",
"Grapefruit",
"Guava",
+ "Honeydew melon",
"Huckleberry",
"Jackfruit",
"Jambul",
@@ -33,23 +35,19 @@ const fruits = [
"Mango",
"Mangostine",
"Melon",
- "Cantaloupe",
- "Honeydew melon",
- "Watermelon",
"Rock melon",
"Nectarine",
"Orange",
"Peach",
"Pear",
- "Williams pear or Bartlett pear",
- "Pitaya",
"Physalis",
- "Plum/prune (dried plum)",
"Pineapple",
+ "Pitaya",
+ "Plum",
"Pomegranate",
+ "Prune",
"Raisin",
"Raspberry",
- "Western raspberry (blackcap)",
"Rambutan",
"Redcurrant",
"Salal berry",
@@ -60,6 +58,8 @@ const fruits = [
"Tomato",
"Ugli fruit",
"Watermelon",
+ "Western raspberry (blackcap)",
+ "Williams pear or Bartlett pear",
"Ziziphus mauritiana"
]
diff --git a/src/lib/components/container.jsx b/src/lib/components/container.jsx
index f12701e..1ff56f5 100644
--- a/src/lib/components/container.jsx
+++ b/src/lib/components/container.jsx
@@ -3,12 +3,16 @@ import setify from 'setify' // Sets input value without changing cursor position
import { StateContext } from '../context/state'
import Items from './items'
import { useDebounce } from 'use-debounce'
-import { useItemsState, useAutoFocus, useQueryChange } from './hooks/containerEffects'
import useData from './hooks/useData'
import undef from '../utils/undef'
import isUndefined from '../utils/isUndefined'
import startsWithCaseInsensitive from '../utils/startsWithCaseInsensitive'
import defaultStyles from './styles/input.styles.js'
+import {
+ useItemsState,
+ useAutoFocus,
+ useQueryChange,
+} from './hooks/containerEffects'
import {
setQuery,
setHighlighted,
@@ -32,7 +36,6 @@ export default function Container(props) {
itemGroupsAreImmutable,
maxItems,
minQueryLength,
- loadingMessage,
noItemsMessage,
onChange,
onSelect,
@@ -61,7 +64,6 @@ export default function Container(props) {
// Component state
const [debouncedQuery] = useDebounce(state.query, debounceWait)
const [hasFocus, setHasFocus] = useState(false)
- const [isLoading, setIsLoading] = useState(false)
// DOM references
const queryInput = useRef(null)
@@ -96,12 +98,6 @@ export default function Container(props) {
// typeahead value and the query value and fire onChnage
useQueryChange(state.query, queryInput, typeaheadInput, onChange)
- // Figure out whether we are able to display a loading state
- useEffect(() => {
- if (state.items && state.items.length) setIsLoading(false)
- else if (state.query.length <= minQueryLength) setIsLoading(true)
- }, [state.items, state.query, minQueryLength, setIsLoading])
-
// When the highlighted item changes, make sure the typeahead matches and format
// the query text to match the case of the typeahead text
useEffect(() => {
@@ -256,9 +252,7 @@ export default function Container(props) {
{isDropdown() && (