-
Notifications
You must be signed in to change notification settings - Fork 642
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
Element index view menus #11915
Element index view menus #11915
Conversation
DEV-994 Element index view menus
Element index sort options should be moved into a “View” disclosure menu, where we could also put additional options such as the ability to choose which table columns are visible (per user + source, like the sort setting). |
@brandonkelly just completed a full audit on the updates! Here are a few a11y issues I noted:
|
DEV-722 The "Sort by" custom select introduces parsing issues caused by multiple options having identical IDs
Page Area: "Sort by" custom select, [data-extra] options Issue Description: All options with attribute [data-extra] have identical IDs, causing parsing issues for screen reader users Action: Ensure all options have unique IDs Screenshot/Code Snippet: Screenshot showing many options with the same IDs Screen Shot 2022-06-29 at 2.48.54 PM.png Resolves CMS-250 |
`title` was getting included as the first attribute, despite not being an available option
Thanks @gcamacho079!
Added
Done.
I’ve tweaked the behavior so the menu no longer closes when you press that button. The button is still removed, though, so I’m moving the focus to the “Close” button instead.
I switched the direction to a listbox instead of a dropdown, which gives the attribute dropdown a bit more room.
Added a media query so any viewport under 400px wide will now stack those “meta” field labels + inputs vertically instead of side-by-side |
@brandonkelly love the button group you introduced to save space. However I'm taking a look at the
The stacking looks great! However I'm still getting a horizontal scrollbar at desktop screen sizes though, and when text size is increased to 200% on Firefox or text-spacing is applied. At 320px, here's the issue that's popping up with the disclosure positioning: |
# Conflicts: # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map # src/web/assets/cp/dist/css/cp.css # src/web/assets/cp/dist/css/cp.css.map
Doh, should have tested on the Assets index page. That menu-out-of-viewport bug is fixed now.
That component is pretty fresh. In core it’s only used for the “Fields”/“UI Elements” toggle within field layout designers, and now this. Not sure if other plugins are using it yet, though. Depending on what you’d want to change, it might make sense to just update the existing component, either for 4.x or just push off to Craft 5. |
[ci skip]
Description
Adds a “View” menu to element index toolbars, with “Sort by” and “Table Columns” settings:
Moving the sort options into the menu and splitting them into two separate select inputs resolves an accessibility issue (DEV-434 – listboxes have no provision for allowing multiple selections but restricted to disparate sub-sets of options within one control).
The Table Columns setting gives users the ability to customize the table columns should be visible, without affecting anyone else.
View menu selections will apply to the currently-selected top-level source and all its descendants. For example, if changes are made to a volume source on the Assets index, the same settings will apply to each of the volume’s subfolders’ sources (and vise-versa).
Related issues