Skip to content

Commit 2369e53

Browse files
committed
release: v0.10.22
1 parent a8881f3 commit 2369e53

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-invenio-forms",
3-
"version": "0.10.21",
3+
"version": "0.10.22",
44
"description": "React components to build forms in Invenio",
55
"main": "dist/cjs/index.js",
66
"browser": "dist/cjs/index.js",

src/lib/forms/widgets/text/BooleanInput.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77

88
import PropTypes from "prop-types";
99
import React from "react";
10-
import { Form } from "semantic-ui-react";
10+
import { Form, Label } from "semantic-ui-react";
1111
import { FieldLabel } from "../../FieldLabel";
1212
import { RadioField } from "../../RadioField";
13+
1314
import { useField } from "formik";
1415

1516
export default function BooleanInput({
@@ -21,12 +22,11 @@ export default function BooleanInput({
2122
trueLabel,
2223
required,
2324
}) {
24-
const [meta] = useField(fieldPath);
25-
console.log(meta);
25+
const [_, meta] = useField(fieldPath);
2626
return (
2727
<>
28-
<Form.Group inline className="mb-0" required>
29-
<Form.Field required={required} error={meta.error}>
28+
<Form.Group inline className="mb-0">
29+
<Form.Field required={required}>
3030
<FieldLabel htmlFor={fieldPath} icon={icon} label={label} />
3131
</Form.Field>
3232
<RadioField
@@ -43,6 +43,13 @@ export default function BooleanInput({
4343
value={false}
4444
optimized
4545
/>
46+
{meta.error && (
47+
<Form.Field required={required} className="error">
48+
<Label pointing="left" prompt>
49+
{meta.error}
50+
</Label>
51+
</Form.Field>
52+
)}
4653
</Form.Group>
4754
{description && <label className="helptext">{description}</label>}
4855
</>

0 commit comments

Comments
 (0)