WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.3k stars 4.11k forks source link

Unify and fix accessibility of the various Pagination components #58133

Open afercia opened 7 months ago

afercia commented 7 months ago

Description

The editor uses a few user interfaces where pagination buttons are in place. For example:

While theoretically these pagination are very similar and should work in a very similar way, they are all different and use different components.

From an accessibility perspective, there are a few issues. Most notably:

I'd tend to think these pagination tools should work and look the same way throughout the whole user interface. It's also a good opportunity to fix the most relevant accessibility issuses and abstract some code.

Screenshots:

Dataviews pagination:

01 pagination dataviews

Patterns explorer pagination:

02 pagination patterns explorer

Global styles revisions pagination:

03 revisions pagination

NEW: Pages pagination: note: as far as I can tell this is the only case where the buttons do not trigger a focus loss because they use arira-disabled instead of disabled. Tooltips work as well. The implementation of the current page indicator is arguable though as it's a mix of translatable strings and labeling / value of the <select> element.

new pages pagination

Step-by-step reproduction instructions

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

mikachan commented 6 months ago

Noting that the Font Library modal also includes a pagination implementation, also discussed in https://github.com/WordPress/gutenberg/pull/59591.

image

t-hamano commented 2 months ago

Related to this issue, I suggested adding the Pagination component.

https://github.com/WordPress/gutenberg/issues/55650