Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAlert has hard-coded title for screen reader #2023
Comments
This comment has been minimized.
This comment has been minimized.
Please check if the logic in #1978 solves your problem. Here's the file:
|
This comment has been minimized.
This comment has been minimized.
From reading the code, it looks like there is still the hard-coded { I don't want my alert to say "Success alert:" |
This comment has been minimized.
This comment has been minimized.
@zach can you please fix this as part of your Pr you already have up. |
This comment has been minimized.
This comment has been minimized.
@ssilvert I just updated my PR to use:
|
This comment has been minimized.
This comment has been minimized.
IMO, this is still wrong. Under no circumstances should the Alert have an unlocalizable, hard-coded message. Just take the message passed in and display it. It's not just for screen reader. It's for everything. No hard-coded messages should ever be displayed to the user. |
This comment has been minimized.
This comment has been minimized.
With the new logic, we do take the message passed in (which is |
This comment has been minimized.
This comment has been minimized.
I don't want a variantLabel to be displayed. And I certainly don't want an unlocalized, hard-coded one to be displayed. I just want to pass in a message and have it displayed exactly as I specified. BTW, the documentation for these properties do not show up here https://patternfly-react.surge.sh/patternfly-4/components/alert/ |
This comment has been minimized.
This comment has been minimized.
The PR that is out will have the exact string you pass it displayed. It will also fix the documentation: https://1978-pr-patternfly-react-patternfly.surge.sh/patternfly-4/components/alert/ If you don't want default |
This comment has been minimized.
This comment has been minimized.
I think that a developer expects to just pass in a message and have that message displayed as-is without modification. Without the docs, it was even more confusing as I didn't know the variantLabel param even existed. As long as the docs tell you how to disable the default behavior, it should be ok. I would add that to the description of the variantLabel and aria-label props. |
Alerts should not have a hard-coded, unlocalizable title. It looks like this was addressed in #601, but now the problem is back?
Now we have: