Skip to content

Commit

Permalink
handle null values
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Jan 10, 2025
1 parent bc09c59 commit 2f5f491
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export function EditableTableCell({ name, table, keyTuple, value: defaultValue }
const { id: chainId } = useChain();
const account = useAccount();

console.log("value", value);

const valueSchema = getValueSchema(table);
const fieldType = valueSchema?.[name as never]?.type;

Expand Down Expand Up @@ -123,7 +125,8 @@ export function EditableTableCell({ name, table, keyTuple, value: defaultValue }
className="w-full bg-transparent"
onChange={(evt: ChangeEvent<HTMLInputElement>) => setValue(evt.target.value)}
onBlur={(evt) => handleSubmit(evt.target.value)}
value={String(value)}
value={value == null ? "" : String(value)}
placeholder={value == null ? "null" : undefined}
disabled={isPending}
/>
</form>
Expand Down

0 comments on commit 2f5f491

Please sign in to comment.