WhyTan00 opened a new issue, #21803:
URL: https://github.com/apache/echarts/issues/21803

   ### Version
   
   6.1.0; source checked on master `34f4d927eafe251f26f63afd3aeefa30f2feba30` 
and release `8ca03d465c1b0301803966f44ea3dd690f29cc94`.
   
   ### Link to Minimal Reproduction
   
   https://gist.github.com/WhyTan00/6f25e6be4ad0dfaad3d3ace1eaa18eb7
   
   ### Steps to Reproduce
   
   ```js
   const el = document.createElement('div');
   document.body.appendChild(el);
   const chart = echarts.init(el, null, { renderer: 'svg', width: 320, height: 
100 });
   chart.setOption({
     aria: { enabled: true, label: { description: 'Old generated description' } 
}
   });
   chart.setOption({ aria: { enabled: false } });
   console.log(el.getAttribute('role'), el.getAttribute('aria-label'));
   // Still: 'img', 'Old generated description'
   ```
   
   The same stale attributes remain when the second update instead disables 
`aria.label.enabled`, or calls `chart.setOption({}, { notMerge: true })` and 
omits ARIA entirely. The reproduction runs the three cases independently.
   
   ### Current Behavior
   
   The container keeps ECharts-generated `role="img"` and the old `aria-label` 
after ARIA or its label is disabled. The stale label can describe a chart state 
that the application has deliberately stopped exposing.
   
   ### Expected Behavior
   
   When label generation is disabled, ECharts should relinquish attributes it 
generated. It should preserve host-owned accessibility attributes, including 
values that existed before enabling ARIA or were changed by the application 
afterward. Re-enabling ARIA should generate the current description again.
   
   ### Environment
   
   - Node.js 24.22.1, jsdom 16.7.0, ECharts 6.1.0 distributed bundle.
   - Renderer: SVG with a real DOM host; this is not `ssr: true`.
   - The attached HTML provides the equivalent browser reproduction. No 
screen-reader acceptance is claimed.
   
   ### Additional Comments
   
   Current `src/visual/aria.ts` returns early when either `aria.enabled` or 
`aria.label.enabled` is false, without cleaning up previously generated DOM 
attributes. The release branch has the same lifecycle behavior. This report is 
independent of the literal-dollar substitution fix #21787, which is already in 
release.
   
   I would like to prepare a focused fix and regression tests in the existing 
ARIA unit suite. Proposed scope: track the last generated role/label on the DOM 
host (so state survives `notMerge`), restore an original value only while 
ECharts still owns the current value, and cover disable, `notMerge`, 
application overrides, and re-enable. No new public option or dependency is 
needed.
   
   Reproduction and proposed fix assisted by OpenAI Codex.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to