Skip to content

Commit

Permalink
[select] fix: set aria-disabled attribute on combobox elements (#5978)
Browse files Browse the repository at this point in the history
  • Loading branch information
bvandercar-vt authored Feb 28, 2023
1 parent 7c59b1e commit 9cd1db2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export class MultiSelect2<T> extends AbstractPureComponent2<MultiSelect2Props<T>
"aria-controls": this.listboxId,
...popoverTargetProps,
...targetProps,
"aria-disabled": disabled,
"aria-expanded": isOpen,
// Note that we must set FILL here in addition to TagInput to get the wrapper element to full width
className: classNames(targetProps.className, popoverTargetProps.className, {
Expand Down
3 changes: 2 additions & 1 deletion packages/select/src/components/select/select2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class Select2<T> extends AbstractPureComponent2<Select2Props<T>, Select2S
// since it may be stale (`renderTarget` is not re-invoked on this.state changes).
// eslint-disable-next-line react/display-name
({ isOpen: _isOpen, ref, ...targetProps }: Popover2TargetProps & Popover2ClickTargetHandlers) => {
const { popoverProps = {}, popoverTargetProps } = this.props;
const { disabled, popoverProps = {}, popoverTargetProps } = this.props;
const { handleKeyDown, handleKeyUp } = listProps;
const { targetTagName = "div" } = popoverProps;
return React.createElement(
Expand All @@ -223,6 +223,7 @@ export class Select2<T> extends AbstractPureComponent2<Select2Props<T>, Select2S
"aria-controls": this.listboxId,
...popoverTargetProps,
...targetProps,
"aria-disabled": disabled,
"aria-expanded": isOpen,
// Note that we must set FILL here in addition to children to get the wrapper element to full width
className: classNames(targetProps.className, popoverTargetProps?.className, {
Expand Down

1 comment on commit 9cd1db2

@adidahiya
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[select] fix: set aria-disabled attribute on combobox elements (#5978)

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Please sign in to comment.