8000 fix(pagination): fixed display for per page menu toggle by mcoker · Pull Request #6586 · patternfly/patternfly · GitHub
[go: up one dir, main page]

Skip to content

fix(pagination): fixed display for per page menu toggle#6586

Merged
dlabaj merged 4 commits intopatternfly:mainfrom
mcoker:issue-6582
Apr 30, 2024
Merged

fix(pagination): fixed display for per page menu toggle#6586
dlabaj merged 4 commits intopatternfly:mainfrom
mcoker:issue-6582

Conversation

@mcoker
Copy link
Contributor
@mcoker mcoker commented Apr 29, 2024

fixes #6582

Also spotted when working on patternfly/patternfly-react#9783

What was broken?

  1. In bottom pagination, the menu toggle is set to display: block, which happened when we swapped out the options menu css for menu toggle for the v5 release - fix(Pagination): updated styles to target menu toggle #5619. Setting display: block on the options menu worked fine, but the menu toggle is a flex layout. Surprisingly though, that didn't cause an issue until...
  2. We added menu toggle validation, and the __controls element was updated to display: flex - fix(menu-toggle): added support for validation/status #6434. When the menu toggle is a flex layout (which it is by default), that's fine - however with the menu toggle as a block layout, that change forces the controls element (holds the toggle arrow) onto a new line causing this bug.

Changes in this PR

CSS

We hide/show the menu toggle quite a bit in pagination depending on viewport size and variations/modifiers used. This PR adds a base var that holds the default display type for the menu toggle (--#{$pagination}--c-menu-toggle--Display--base: inline-flex;) and replaces all of the places we're showing the menu toggle via display: inline-flex or display: block to use that var.

HBS

Updates pagination to use the menu toggle, and various updates to support that change, more info on that below called out in the individual commits.

First commit is the styling update and pulling in the menu toggle to the example.

Second commit is just a s/pagination-options-menu/pagination-menu-toggle/g from /src/patternfly. That puts a lot of noise in the "files changed" tab, but it's all just that search/replace.

Last commit

  • Removes the top expanded example. Core doesn't have a good way to show an expanded menu-toggle/menu pair, and we would need a decent set of overrides to show the menu and make sure the menu is only shown when appropriate. We hide the menu-toggle (implying the menu is hidden, too) at different breakpoints and with modifiers and we currently have no menu-specific styles in pagination, so in the short term I just removed that example. wdyt @andrew-ronaldson @srambach @tlabaj, any objections to that?
  • Adds an aria-label to the pagination menu toggle
  • Updates a handful of id strings from "options-menu" to "menu-toggle"

@patternfly-build
Copy link
Collaborator
patternfly-build commented Apr 29, 2024

@mcoker mcoker requested a review from tlabaj April 29, 2024 19:44
Copy link
Contributor
@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment below. This would also close out #6094 I assume?

menu-toggle--IsPlain=true
menu-toggle--IsText=true
menu-toggle--modifier=pagination-menu-toggle--modifier menu-toggle--id=pagination-menu-toggle--id
menu-toggle--attribute='aria-label="Items per page"'}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we want to override the accessible name here. "Items per page" is accurate, but the context of the "item range of total items" is something we probably want to keep exposed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thatblindgeye nice, that aria-label was borrowed from the old options menu - took it out.

re: #6094, at least one difference I'd love to see for v6 (since it's breaking) is a .pf-[v]-c-pagination__per-page-menu (or something named better than that anyways!) to hold that menu/menu-toggle and we show/hide that element instead. wdyt? Otherwise it's probably the same update. WDYT?

Copy link
Member
@srambach srambach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, fabulous explanation of the changes. 🌟 Thank you for that!

Copy link
Contributor
@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcoker mcoker requested a review from thatblindgeye April 30, 2024 19:08
@dlabaj dlabaj merged commit 1bdbc26 into patternfly:main Apr 30, 2024
@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 5.4.0-prerelease.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

dlabaj pushed a commit to dlabaj/patternfly that referenced this pull request Apr 30, 2024
)

* fix(pagination): fixed display for per page menu toggle

* chore(pagination): s/pagination-options-menupagination-menu-toggle

* chore(pagination): remove top expanded, add toggle aria-label

* Update pagination-menu-toggle.hbs

remove aria-label
@dlabaj dlabaj mentioned this pull request Apr 30, 2024
dlabaj added a commit to dlabaj/patternfly that referenced this pull request Apr 30, 2024
)

* fix(pagination): fixed display for per page menu toggle

* chore(pagination): s/pagination-options-menupagination-menu-toggle

* chore(pagination): remove top expanded, add toggle aria-label

* Update pagination-menu-toggle.hbs

remove aria-label
fix(lint): fixed lint issue
dlabaj pushed a commit to dlabaj/patternfly that referenced this pull request Apr 30, 2024
)

* fix(pagination): fixed display for per page menu toggle

* chore(pagination): s/pagination-options-menupagination-menu-toggle

* chore(pagination): remove top expanded, add toggle aria-label

* Update pagination-menu-toggle.hbs

remove aria-label
@dlabaj dlabaj mentioned this pull request Apr 30, 2024
dlabaj added a commit that referenced this pull request May 1, 2024
* fix(release): updated code to release patch to npmjs

* fix(TreeView): improved a11y experience (#6480)

* fix(TreeView): improved a11y experience

* Updated aria-label to match React PR

* Updated tabindices

* Reverted changes affecting tabindices

* fix(pagination): fixed display for per page menu toggle (#6586)

* fix(pagination): fixed display for per page menu toggle

* chore(pagination): s/pagination-options-menupagination-menu-toggle

* chore(pagination): remove top expanded, add toggle aria-label

* Update pagination-menu-toggle.hbs

remove aria-label

---------

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
Co-authored-by: Michael Coker <35148959+mcoker@users.noreply.github.com>
@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 5.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mcoker mcoker deleted the issue-6582 branch January 7, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - Pagination - bottom variant wraps since 5.3.0

6 participants

0