fix: checkbox cell.

This commit is contained in:
elforjani3
2021-07-31 19:04:44 +02:00
parent 596d3266e1
commit 042a7f3693
3 changed files with 5 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ const CheckboxEditableCell = ({
const [value, setValue] = React.useState(initialValue);
const onChange = (e) => {
setValue(e.target.value);
setValue(e.target.checked);
};
const onBlur = () => {
payload.updateData(index, id, value);
@@ -24,12 +24,13 @@ const CheckboxEditableCell = ({
return (
<FormGroup
// intent={error ? Intent.DANGER : null}
intent={error ? Intent.DANGER : null}
className={classNames(Classes.FILL)}
>
<Checkbox
value={value}
onChange={onChange}
checked={initialValue}
onBlur={onBlur}
minimal={true}
className="ml2"

View File

@@ -79,10 +79,7 @@ function ExpenseForm({
}
const categories = values.categories.filter(
(category) =>
category.amount &&
category.index &&
category.expense_account_id &&
category.landed_cost,
category.amount && category.index && category.expense_account_id,
);
const form = {

View File

@@ -31,7 +31,7 @@ export const defaultExpenseEntry = {
amount: '',
expense_account_id: '',
description: '',
landed_cost: false,
landed_cost: 0,
};
export const defaultExpense = {