Hi Community,
I am working on a Forge app with Custom UI + AtlasKit and ran into a problem when using checkbox fields. It can be reproduced in CodeSandbox, by tweaking the example code a bit.
On the first click in any of the checkboxes, formProps is logged, but on any subsequent interactions, nothing is logged.
Can anyone explain what is happening here and why? Is this a bug?
import React from "react";
import Button from "@atlaskit/button/new";
import { Checkbox } from "@atlaskit/checkbox";
import Form, { CheckboxField, Fieldset, FormFooter } from "@atlaskit/form";
import { Flex } from "@atlaskit/primitives/compiled";
const FormCheckboxExample = (): React.JSX.Element => {
return (
<Flex direction="column">
<Form onSubmit={(data) => console.log(data)}>
{({ formProps }) => {
console.log("formProps", formProps);
return (
<form {...formProps}>
<Fieldset legend="Apps">
<CheckboxField name="app" value="jira">
{({ fieldProps }) => (
<Checkbox {...fieldProps} label="Jira" />
)}
</CheckboxField>
<CheckboxField name="app" value="confluence">
{({ fieldProps }) => (
<Checkbox {...fieldProps} label="Confluence" />
)}
</CheckboxField>
<CheckboxField name="app" value="bitbucket">
{({ fieldProps }) => (
<Checkbox {...fieldProps} label="Bitbucket" />
)}
</CheckboxField>
</Fieldset>
<FormFooter align="start">
<Button type="submit" appearance="primary">
Submit
</Button>
</FormFooter>
</form>
);
}}
</Form>
</Flex>
);
};
export default FormCheckboxExample;
Regards,
Ferenc