Skip to content

Commit

Permalink
Merge pull request #3396 from bettyblocks/feat/update-inputs-pagevar-…
Browse files Browse the repository at this point in the history
…belongsto-support-PAGE-4109

feat: enabled resetting value of autocomplete
  • Loading branch information
JorisPannekeet authored Mar 11, 2024
2 parents ddd5683 + 3e795f0 commit 412d553
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/autocompleteInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,16 @@
idProperty;

useEffect(() => {
setValue(defaultValue.replace(/\n/g, ''));
if (defaultValue) {
defaultValueEvaluatedRef.current = false;
setValue(initalValue);
setInputValue('');
} else {
defaultValueEvaluatedRef.current = true;
setValue('');
setInputValue('');
setDebouncedInputValue('');
}
}, [defaultValue]);

/*
Expand Down

0 comments on commit 412d553

Please sign in to comment.