Skip to content

Commit 62cddda

Browse files
committed
chore: cleanup onChange usages
Related to #1147
1 parent 78ff247 commit 62cddda

File tree

11 files changed

+6
-15
lines changed

11 files changed

+6
-15
lines changed

packages/form-js-playground/test/custom/viewer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function RangeRenderer(props) {
2121

2222
const onChange = ({ target }) => {
2323
props.onChange({
24-
field,
2524
value: Number(target.value),
2625
});
2726
};

packages/form-js-viewer/src/features/repeatRender/RepeatRenderManager.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ export class RepeatRenderManager {
128128
shouldScroll.current = true;
129129

130130
props.onChange({
131-
field: repeaterField,
132131
value: updatedValues,
133-
indexes,
134132
});
135133

136134
setSharedRepeatState((state) => ({ ...state, isCollapsed: false }));

packages/form-js-viewer/src/render/components/form-fields/Checkbox.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export function Checkbox(props) {
1717

1818
const onChange = ({ target }) => {
1919
props.onChange({
20-
field,
2120
value: target.checked,
2221
});
2322
};

packages/form-js-viewer/src/render/components/form-fields/Checklist.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export function Checklist(props) {
3131
: [...values, toggledValue];
3232

3333
props.onChange({
34-
field,
3534
value: newValues,
3635
});
3736
};

packages/form-js-viewer/src/render/components/form-fields/Radio.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export function Radio(props) {
2727

2828
const onChange = (v) => {
2929
props.onChange({
30-
field,
3130
value: v,
3231
});
3332
};

packages/form-js-viewer/src/render/components/form-fields/Taglist.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ export function Taglist(props) {
7676
return;
7777
}
7878

79-
props.onChange({ value: [...values, value], field });
79+
props.onChange({ value: [...values, value] });
8080
};
8181

8282
const deselectValue = (value) => {
8383
const newValues = values.filter((v) => !isEqual(v, value));
84-
props.onChange({ value: newValues, field });
84+
props.onChange({ value: newValues });
8585
};
8686

8787
const onInputChange = ({ target }) => {

packages/form-js-viewer/src/render/components/form-fields/Textarea.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export function Textarea(props) {
2121

2222
const [onChange, flushOnChange] = useFlushDebounce(({ target }) => {
2323
props.onChange({
24-
field,
2524
value: target.value,
2625
});
2726
});

packages/form-js-viewer/src/render/components/form-fields/Textfield.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export function Textfield(props) {
2121

2222
const [onInputChange, flushOnChange] = useFlushDebounce(({ target }) => {
2323
props.onChange({
24-
field,
2524
value: target.value,
2625
});
2726
});

packages/form-js-viewer/src/render/components/form-fields/parts/SearchableSelect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ export function SearchableSelect(props) {
5454
const setValue = useCallback(
5555
(option) => {
5656
setFilter((option && option.label) || '');
57-
props.onChange({ value: (option && option.value) || null, field });
57+
props.onChange({ value: (option && option.value) || null });
5858
},
59-
[field, props],
59+
[props],
6060
);
6161

6262
const displayState = useMemo(() => {

packages/form-js-viewer/src/render/components/form-fields/parts/SimpleSelect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export function SimpleSelect(props) {
3333

3434
const setValue = useCallback(
3535
(option) => {
36-
props.onChange({ value: (option && option.value) || null, field });
36+
props.onChange({ value: (option && option.value) || null });
3737
},
38-
[field, props],
38+
[props],
3939
);
4040

4141
const displayState = useMemo(() => {

0 commit comments

Comments
 (0)