Skip to content

Commit

Permalink
fix(combobox): disclosure
Browse files Browse the repository at this point in the history
  • Loading branch information
andresin87 committed Mar 13, 2024
1 parent 6b9698b commit 52eb035
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/components/combobox/src/ComboboxDisclosure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const Disclosure = forwardRef(
const ctx = useComboboxContext()

const { ref: downshiftRef, ...downshiftDisclosureProps } = ctx.getToggleButtonProps({
disabled: ctx.disabled || ctx.readOnly,
onClick: event => {
event.stopPropagation()
},
Expand All @@ -46,6 +47,7 @@ export const Disclosure = forwardRef(
{...downshiftDisclosureProps}
{...props}
aria-label={isOpen ? openedLabel : closedLabel}
disabled={ctx.disabled}
>
<Icon>
<Icon className="shrink-0" size="sm">
Expand Down
3 changes: 1 addition & 2 deletions packages/components/combobox/src/ComboboxTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const Trigger = forwardRef(
const readOnly = field.readOnly || ctx.readOnly

const hasClearButton = !!clearButton && !disabled && !readOnly
const hasDisclosure = !!disclosure && !disabled && !readOnly

return (
<>
Expand Down Expand Up @@ -62,7 +61,7 @@ export const Trigger = forwardRef(
{input}
</div>
{hasClearButton && clearButton}
{hasDisclosure && disclosure}
{disclosure}
</div>
</PopoverAnchor>
</>
Expand Down

0 comments on commit 52eb035

Please sign in to comment.