react-component / dialog

React Dialog
https://dialog.react-component.vercel.app/
MIT License
438 stars 187 forks source link

static aria-label, no possibility to change for other language #382

Open DmitriBountsman opened 10 months ago

DmitriBountsman commented 10 months ago

There is no possibility to change aria-label either via a locale file or component properties. That breaks disability tests for other languages (in my case German). https://github.com/react-component/dialog/blob/ecc8da988f03ef2d54e67f6e77a2f53483b812aa/src/Dialog/Content/Panel.tsx#L100

yoyo837 commented 10 months ago

PR welcome

DmitriBountsman commented 10 months ago

I will commit a PR with a new property in near future.

A quick fix is to set aria-label="Close" only when closeIcon is not set (e.g. in antd closeIcon is always set and has its own aria-label). aria-label={closeIcon ? undefined : "Close"}

DmitriBountsman commented 10 months ago

PR: https://github.com/react-component/dialog/pull/385