Skip to content

Commit

Permalink
Merge da76ca4 into 74fb409
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzaijiang committed Mar 30, 2022
2 parents 74fb409 + da76ca4 commit c663f76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/components/checkbox/__tests__/checkboxGroup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ describe('CheckboxGroup', () => {
test('dataSource work', async () => {
let dataSource = [
{ label: 'option1', value: 'option1' },
{ label: 'option2', value: 'option2' },
{ label: 'option2', value: 'option2', disabled: true },
]
const wrapper = CheckboxGroupMount({ props: { dataSource } })

expect(wrapper.findAll('.ix-checkbox').length).toBe(2)

expect(wrapper.findAll('.ix-checkbox-disabled').length).toBe(1)

dataSource = [
{ label: 'option1', value: 'option1' },
{ label: 'option2', value: 'option2' },
Expand Down
2 changes: 1 addition & 1 deletion packages/components/checkbox/src/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const useCheckbox = (props: CheckboxProps, checkboxGroup: CheckboxGroupContext |
if (checkboxGroup) {
const { props: groupProps, accessor } = checkboxGroup
isChecked = computed(() => (accessor.valueRef.value ?? []).includes(props.value ?? props.trueValue))
isDisabled = computed(() => accessor.disabled.value ?? !!props.disabled)
isDisabled = computed(() => props.disabled ?? accessor.disabled.value)

handleBlur = (evt: FocusEvent) => {
isFocused.value = false
Expand Down

0 comments on commit c663f76

Please sign in to comment.