-
Notifications
You must be signed in to change notification settings - Fork 94
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
Bug - Table - Adding screenReaderText
to a empty Th
element changes column width
#6643
Comments
As requested by this warning: Th: Table headers must have an accessible name. If the Th is intended to be visually empty, pass in screenReaderText. If the Th contains only non-text, interactive content such as a checkbox or expand toggle, pass in an aria-label. We can't use screenReaderText because of patternfly/patternfly#6643
As requested by this warning: Th: Table headers must have an accessible name. If the Th is intended to be visually empty, pass in screenReaderText. If the Th contains only non-text, interactive content such as a checkbox or expand toggle, pass in an aria-label. We can't use screenReaderText because of patternfly/patternfly#6643
As requested by this warning: Th: Table headers must have an accessible name. If the Th is intended to be visually empty, pass in screenReaderText. If the Th contains only non-text, interactive content such as a checkbox or expand toggle, pass in an aria-label. We can't use screenReaderText because of patternfly/patternfly#6643
Correct, which means this declaration will be updated to accommodate screen reader text. |
As requested by this warning: Th: Table headers must have an accessible name. If the Th is intended to be visually empty, pass in screenReaderText. If the Th contains only non-text, interactive content such as a checkbox or expand toggle, pass in an aria-label. We can't use screenReaderText because of patternfly/patternfly#6643
Adding
screenReaderText
to a emptyTh
element changes themin-width
property of the element, which might change column width.We have a table with a empty
Th
for the first column. That column contains icons:The code for the header is pretty straighforward:
But we have started to receive this warning recently:
The correct thing to do seems to be to add
screenReaderText="Category"
to make the first column more accessible. This however results in a changed layout:The first column is now much wider than it needs to be.
This happens because Patternfly has a CSS rule that sets the
min-width
property of elements insidethead
to some largish value, except when the element is empty according to the:empty
pseudo-class, in which case themin-width
property is zero. Our layout relies on this exception.Giving
screenReaderText
a value will add a invisible element into theTh
, which causes the "min-width: 0" exception to no longer apply.I had expected that adding
screenReaderText
does not influence the layout. We will have to usearia-label
instead, I guess.This is an issue with
The text was updated successfully, but these errors were encountered: