Skip to content
Snippets Groups Projects
Unverified Commit cbde44de authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Fix form field alignment for checkboxes (#28403)

parent 18bc3f29
No related branches found
No related tags found
No related merge requests found
......@@ -72,13 +72,16 @@ export const FieldInfoLabel = styled.div`
`;
export interface FieldRootProps {
alignment: FieldAlignment;
orientation: FieldOrientation;
}
export const FieldRoot = styled.div<FieldRootProps>`
display: ${props => props.orientation === "horizontal" && "flex"};
justify-content: ${props =>
props.orientation === "horizontal" && "space-between"};
props.alignment === "end" &&
props.orientation === "horizontal" &&
"space-between"};
margin-bottom: 1.25rem;
&:focus-within {
......
......@@ -45,7 +45,12 @@ const FormField = forwardRef(function FormField(
const hasError = Boolean(error);
return (
<FieldRoot {...props} ref={ref} orientation={orientation}>
<FieldRoot
{...props}
ref={ref}
alignment={alignment}
orientation={orientation}
>
{alignment === "start" && children}
{(title || description) && (
<FieldCaption alignment={alignment} orientation={orientation}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment