Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart : [Accessibility] canvasProps property #7118

Closed
kyybo opened this issue Sep 5, 2024 · 2 comments · Fixed by #7119 · May be fixed by leoo1992/GeradorQRCode#95
Closed

Chart : [Accessibility] canvasProps property #7118

kyybo opened this issue Sep 5, 2024 · 2 comments · Fixed by #7119 · May be fixed by leoo1992/GeradorQRCode#95
Assignees
Labels
Component: Documentation Issue or pull request is related to Documentation
Milestone

Comments

@kyybo
Copy link
Contributor

kyybo commented Sep 5, 2024

Describe the bug

The “Accessibility” section of the Chart component is not in line with the current implementation (https://primereact.org/chart/#accessibility).

It says: “The canvas element can be customized with canvasProps property to define aria roles and properties”. However, the canvasProps property is not available in PrimeReact. Since commit #3982, it's only possible to specify an ariaLabel property.

It's quite possible that this “Accessibility” section was initially copy/pasted from PrimeVue.

2 possibilities:

  • either the “Accessibility” section needs to be corrected so that it describes the current behavior.
  • or change the implementation to match the current description. In other words, provide the canvasProps property, through which we can define the aria roles and properties (and therefore remove the ariaLabel property, as it can be defined in canvasProps). This is the current behavior in PrimeVue.

Reproducer

No response

System Information

"primereact": "10.8.2"
"react": "^18.2.0"

Steps to reproduce the behavior

No response

Expected behavior

No response

@kyybo kyybo added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 5, 2024
@kyybo kyybo changed the title Chart : [Accessibility] canvasProps attribute Chart : [Accessibility] canvasProps property Sep 5, 2024
@melloware
Copy link
Member

Its because you can do it through PT using the cavnas.

 <Chart
        type="bar"
        data={chartData}
        options={chartOptions}
        pt={{
          canvas: { 'aria-label': 'Test', 'aria-describedby': 'My Label' },
        }}
      />

see: https://stackblitz.com/edit/cbhceq?file=package.json,src%2FApp.tsx

@melloware melloware added Component: Accessibility Issue or pull request is related to WCAG or ARIA and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 5, 2024
@melloware
Copy link
Member

So yes a PR updating the Docs would be great!

@melloware melloware added Component: Documentation Issue or pull request is related to Documentation and removed Component: Accessibility Issue or pull request is related to WCAG or ARIA labels Sep 5, 2024
kyybo added a commit to kyybo/primereact that referenced this issue Sep 5, 2024
Fix primefaces#7118 : Updating Chart accessibility documentation

The documentation mentions a 'canvasProps' property which is not available in PrimeReact. 
To define aria roles and properties, the 'pt' property must be used insteed.
@melloware melloware added this to the 10.8.3 milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Issue or pull request is related to Documentation
Projects
None yet
2 participants