diff --git a/scss/components/form/_checks.scss b/scss/components/form/_checks.scss index b9e884031..d8911c73e 100644 --- a/scss/components/form/_checks.scss +++ b/scss/components/form/_checks.scss @@ -2,6 +2,7 @@ margin: 0 $gap-sm 0 0; font-weight: $fontWeightNormal; user-select: none; + pointer-events: none; input { opacity: 0; @@ -20,8 +21,10 @@ display: inline-block; vertical-align: middle; position: relative; + pointer-events: all; + span { + pointer-events: all; margin-left: $Checkbox-gap; cursor: pointer; @@ -230,6 +233,7 @@ color: $text--muted-color; margin-left: $Checkbox-gap; margin-top: $gap-xs; + pointer-events: all; } } @@ -274,6 +278,22 @@ } .#{$ns}Checkboxes { + > .#{$ns}Checkbox { + display: block; + height: $Form-input-height; + line-height: $Form-input-lineHeight; + font-size: $Form-input-fontSize; + padding: ( + $Form-input-height - $Form-input-lineHeight * $Form-input-fontSize + )/2 $gap-sm + ($Form-input-height - $Form-input-lineHeight * $Form-input-fontSize)/2 + ($gap-sm + $Checkbox-size); + } + + &--inline > .#{$ns}Checkbox { + display: inline-block; + } + &-addBtn { display: block; cursor: pointer; diff --git a/scss/components/form/_selections.scss b/scss/components/form/_selections.scss index 83e8ed781..ef51edc70 100644 --- a/scss/components/form/_selections.scss +++ b/scss/components/form/_selections.scss @@ -27,8 +27,6 @@ &-items { flex-grow: 1; - height: 0; - overflow: auto; } &-item { diff --git a/src/components/Checkboxes.tsx b/src/components/Checkboxes.tsx index 7db2358a8..994bfdf9c 100644 --- a/src/components/Checkboxes.tsx +++ b/src/components/Checkboxes.tsx @@ -8,117 +8,111 @@ import React from 'react'; import uncontrollable from 'uncontrollable'; import Checkbox from './Checkbox'; import chunk from 'lodash/chunk'; -import {ClassNamesFn, themeable} from '../theme'; -import {Option, OptionProps, value2array} from './Select'; +import {ClassNamesFn, themeable, ThemeProps} from '../theme'; +import {Option, value2array, Options} from './Select'; +import find from 'lodash/find'; // import isPlainObject from 'lodash/isPlainObject'; -interface CheckboxesProps extends OptionProps { - id?: string; - key?: string; +interface CheckboxesProps extends ThemeProps { + options: Options; className?: string; - type: string; placeholder?: string; - disabled?: boolean; - value?: string; - onChange?: Function; + value?: Array; + onChange?: (value: Array