Checkbox: Fixes vertical layout isssue with Checkboxes due to fixed height (#35022) (#35055)

(cherry picked from commit dc5e7695e4)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
This commit is contained in:
Grot (@grafanabot)
2021-06-01 16:37:57 +02:00
committed by GitHub
co-authored by Torkel Ödegaard
parent 7727ba3f69
commit 2f5d699a3e
2 changed files with 23 additions and 1 deletions
@@ -1,6 +1,7 @@
import React, { useState, useCallback } from 'react';
import mdx from './Checkbox.mdx';
import { Checkbox } from './Checkbox';
import { VerticalGroup } from '../Layout/Layout';
export default {
title: 'Forms/Checkbox',
@@ -34,3 +35,25 @@ export const uncontrolled = () => {
/>
);
};
export const StackedList = () => {
return (
<VerticalGroup>
<Checkbox
defaultChecked={true}
label="Skip TLS cert validation"
description="Set to true if you want to skip TLS cert validation"
/>
<Checkbox
defaultChecked={true}
label="Another checkbox"
description="Another long description that does not make any sense"
/>
<Checkbox
defaultChecked={true}
label="Another checkbox times 2"
description="Another long description that does not make any sense or does it?"
/>
</VerticalGroup>
);
};
@@ -65,7 +65,6 @@ export const getCheckboxStyles = stylesFactory((theme: GrafanaTheme2) => {
position: relative;
padding-left: ${checkboxSize};
vertical-align: middle;
height: ${theme.spacing(3)};
`,
input: css`
position: absolute;