Skip to content

Commit

Permalink
fix(a11y): datagrid - invalid aria-attributes in manage column (#1684)
Browse files Browse the repository at this point in the history
## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ] If applicable, have a visual design approval

## PR Type

What kind of change does this PR introduce?
Fix for Accessibility issues
<!-- Please check the one that applies to this PR using "x". -->

- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:

## What is the current behavior?
`aria-expanded` property is not added to the element since default value
is set to undefined. Without this property, `aria-controls` and
`aria-owns` will be an invalid property.

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->

Issue Number: CDE-2542, VPAT-28111

## What is the new behavior?
Added aria-haspopup attribute and aria-expanded property set to false by
default.

## Does this PR introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this PR contains a breaking change, please describe the impact
and migration path for existing applications below. -->

## Other information
  • Loading branch information
venkateshr06 authored Feb 3, 2025
1 parent 31bb1c2 commit b8417d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/angular/src/data/datagrid/datagrid-column-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import { ColumnsService } from './providers/columns.service';
clrPopoverAnchor
clrPopoverOpenCloseButton
[attr.aria-controls]="popoverId"
[attr.aria-owns]="popoverId"
[attr.aria-expanded]="openState"
[attr.aria-haspopup]="'menu'"
>
{{ commonStrings.keys.pickColumns }}
</button>
Expand Down Expand Up @@ -83,7 +83,7 @@ import { ColumnsService } from './providers/columns.service';
})
export class ClrDatagridColumnToggle implements OnDestroy {
popoverId = uniqueIdFactory();
openState: boolean;
openState = false;

// Smart Popover
smartPosition: ClrPopoverPosition = {
Expand Down

0 comments on commit b8417d0

Please # to comment.