fix(native-filters): force update control value on change (#14385)

* fix(native-filters): force update control value on change

* fix test
This commit is contained in:
Ville Brofeldt 2021-04-28 11:41:22 +03:00 committed by GitHub
parent fc0c1155c2
commit 43ee52be57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -123,6 +123,6 @@ test('Clickin on checkbox when resetConfig:flase', () => {
expect(props.forceUpdate).not.toBeCalled();
expect(setNativeFilterFieldValues).not.toBeCalled();
userEvent.click(screen.getByRole('checkbox'));
expect(props.forceUpdate).not.toBeCalled();
expect(props.forceUpdate).toBeCalled();
expect(setNativeFilterFieldValues).not.toBeCalled();
});

View File

@ -72,6 +72,7 @@ const ControlItems: FC<ControlItemsProps> = ({
<Checkbox
onChange={() => {
if (!controlItem.config.resetConfig) {
forceUpdate();
return;
}
setNativeFilterFieldValues(form, filterId, {