feat(Table): add tooltip for truncated Td, docs(Filter): add filter demos
What: Closes #7965
Adds remaining filter demos (attribute search, same select filter group, mixed select filter group, faceted filter).
Updates all filter demos to have the following:
- Bulk select respects filtered state
- Menu ids are unique between demos
- Checkbox column space is maintained when there is an empty state
-
Tds are truncated to maintain column widths while filtering
While adding the last bullet I also noticed that no tooltip is added when Tds are truncated like Ths should I added that functionality as well.
Other updates in this PR:
-
Td: Addedtooltipprop, and when using the truncate modifier,Tdwill attempt to make a default tooltip likeTh -
Th: Updated internalcanDefaultvariable name tocanMakeDefaultTooltip(matched inTdas well) -
MenuToggle: Added missing ref spread to split button variant of theMenuToggle -
Menu: added null check increateNavigableItemscallback that can throw a console error if the menu closes due to the extraKeys handler
Preview: https://patternfly-react-pr-8024.surge.sh
A11y report: https://patternfly-react-pr-8024-a11y.surge.sh
@kmcfaul looks great overall!! Only noticed one little bug in the last demo, where there should be a badge showing the number of selections - and it seems to work for the first attribute, but not for the second. As soon as you select anything from the second attribute, the badge disappears.
https://user-images.githubusercontent.com/51165119/192321668-2a140037-1cd3-4492-a938-9b3e5e531539.mov
Fixed the faceted filter badge. @mmenestr @wise-king-sullyman
Not sure why but the check being inline wasn't quite executing right (it was only looking at the first condition), probably a syntax thing. Moving the check above to a const lets it work properly.
The tooltip prop is for specifying a custom tooltip when a tooltip is rendered (when there is the truncate modifier and the text length overflows). I don't think it forces the tooltip but I'm not sure. It should behave the same as the Th prop. @nicolethoen @mcoker
We may want to open a follow up for the extra tooltips as I'm not sure what's happening there at the moment. I added a tooltip to Td but I don't think that would be causing a Th to render a second tooltip.
Your changes have been released in:
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- [email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
Thanks for your contribution! :tada: