Ensure a combo always autosave value on change
This commit is contained in:
parent
d6c83ec853
commit
6ca9daab0f
1 changed files with 2 additions and 0 deletions
|
@ -10,6 +10,7 @@ import {
|
|||
ComboboxOption
|
||||
} from '@reach/combobox';
|
||||
import '@reach/combobox/styles.css';
|
||||
import { fire } from '@utils';
|
||||
|
||||
function defaultTransformResults(_, results) {
|
||||
return results;
|
||||
|
@ -39,6 +40,7 @@ function ComboSearch({
|
|||
const setExternalValue = useCallback((value) => {
|
||||
if (hiddenField) {
|
||||
hiddenField.setAttribute('value', value);
|
||||
fire(hiddenField, 'autosave:trigger');
|
||||
}
|
||||
if (onChange) {
|
||||
const result = resultsMap.current[value];
|
||||
|
|
Loading…
Add table
Reference in a new issue