echarts icon indicating copy to clipboard operation
echarts copied to clipboard

fix: aria throws error in SSR (#19191)

Open OverflowCat opened this issue 10 months ago • 1 comments

Brief Information

This pull request is in the type of:

  • [x] bug fixing
  • [ ] new feature
  • [ ] others

What does this PR do?

Skip setting aria label attribute when in SSR mode.

Fixed issues

#19191: [Bug] SVG ARIA doesn’t work with SSR

Details

Before: What was the problem?

aria-label was set on the DOM element, but in SSR there is no DOM element, so it would throw when enabling aria or locals in options when using SSR, because the dom variable in code is null.

Also, this makes the last example in this release note (Two color locals) not working in SSR.

html demo

After: How does it behave after the fixing?

No aria label was added, but locals are working in SSR.

Document Info

One of the following should be checked.

  • [x] This PR doesn't relate to document changes
  • [ ] The document should be updated later
  • [ ] The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

  • [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

N.A.

Others

Merging options

  • [ ] Please squash the commits into a single one when merging.

Other information

OverflowCat avatar May 04 '24 00:05 OverflowCat

Thanks for your contribution! The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

echarts-bot[bot] avatar May 04 '24 00:05 echarts-bot[bot]

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-19892@872ac99

github-actions[bot] avatar May 06 '24 05:05 github-actions[bot]

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

echarts-bot[bot] avatar May 06 '24 05:05 echarts-bot[bot]