Handle autocomplete input changes to keep selection

This commit is contained in:
beatz174-bit
2025-11-23 10:03:49 +10:00
parent 0d6f6d2e96
commit 86c65dd112
+9 -1
View File
@@ -83,7 +83,15 @@ export const AddItemScreen = () => {
value={selectedProduct}
onChange={(_, value) => setSelectedProduct(value)}
inputValue={query}
onInputChange={(_, value) => setQuery(value)}
onInputChange={(_, value, reason) => {
if (reason === 'input') {
setQuery(value);
}
if (reason === 'clear') {
setQuery('');
}
}}
filterOptions={(options) => options}
noOptionsText={query.trim() ? 'No matching products' : 'No products available'}
fullWidth