fix(data-grid/text-cell): pass accessibilityTitle to prefix and suffix icons#2487
fix(data-grid/text-cell): pass accessibilityTitle to prefix and suffix icons#2487Ricardo-Tele wants to merge 2 commits intotelekom:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #2194 by ensuring accessibilityTitle values are forwarded to prefix/suffix icons rendered in Data Grid text cells, improving screen-reader support for icon-only affordances in cells.
Changes:
- Extend the Data Grid text cell renderer to pass
accessibility-titleto prefix/suffix icon components (withlabelas fallback). - Add unit tests verifying explicit and fallback accessibility titles for text-cell prefix/suffix icons.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
packages/components/src/components/data-grid/cell-handlers/text-cell.tsx |
Forwards accessibility-title to dynamically-rendered prefix/suffix icon tags, falling back to the field label. |
packages/components/src/components/data-grid/data-grid.spec.ts |
Adds regression tests for forwarding and fallback behavior for text cell icon accessibility titles. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| expect(icons).toHaveLength(2); | ||
| expect(icons[0].getAttribute('accessibility-title')).toBe('Status'); | ||
| expect(icons[0].querySelector('title').textContent).toBe('Status'); | ||
| expect(icons[1].getAttribute('accessibility-title')).toBe('Status'); | ||
| expect(icons[1].querySelector('title').textContent).toBe('Status'); |
| beforeEach(() => { | ||
| (global as any).ResizeObserver = class { | ||
| observe() {} | ||
| unobserve() {} | ||
| disconnect() {} | ||
| }; | ||
| }); |
| expect(icons[0].getAttribute('accessibility-title')).toBe( | ||
| 'Download attachment' | ||
| ); | ||
| expect(icons[0].querySelector('title').textContent).toBe( | ||
| 'Download attachment' | ||
| ); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #2194 by ensuring accessibilityTitle information is forwarded to prefix/suffix icons rendered inside data grid text cells, improving screen-reader support.
Changes:
- Forward
iconPrefixAccessibilityTitle/iconSuffixAccessibilityTitleto the renderedscale-icon-*elements inTextCell, with a fallback to the columnlabel. - Add Stencil spec tests validating the forwarded icon accessibility titles and the label fallback behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/components/src/components/data-grid/cell-handlers/text-cell.tsx | Passes accessibility-title to prefix/suffix icons, defaulting to the field label. |
| packages/components/src/components/data-grid/data-grid.spec.ts | Adds regression tests covering the new forwarding behavior and fallback behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {h(`scale-icon-${iconPrefix}`, { | ||
| 'accessibility-title': iconPrefixAccessibilityTitle ?? label, | ||
| })} |
| {h(`scale-icon-${iconSuffix}`, { | ||
| 'accessibility-title': iconSuffixAccessibilityTitle ?? label, | ||
| })} |
Fixes #2194
The accessibilityTitle is now forwarded to prefix and suffix icons rendered in data grid text cells. This improves accessibility for screen reader users. Regression tests were added to cover the updated behavior.