WordPress / gutenberg

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

Popovers with form controls for settings should use Cancel and Save buttons #63310

Open afercia opened 2 weeks ago

afercia commented 2 weeks ago

Description

In the new Post summary panel, some settings previously placed within collapsible panels have been moved to Popovers. This made more evident some pre-existing accessibility issues with this pattern, especially in terms of keyboard interaction.

There are some long established conventions when it comes to keyboard interaction and UI dialogs / popovers. To me, the two most important ones in this case are. As a user:

Instead, when usign the keyboard in most of these popovers the only way to close the popover is to press the Escape key or the X close button but that doesn't reverts or cancel. The changed values are already saved on the onChange event. This isn;t what I would expect.

I'd like to collect some feedback from more accessibility specialists cc @joedolson. In my opinion, in this kind of popovers saving should always performed after an explicit user action. This is different from an input or other controls placed 'inline' in the UI, where it may make sense to save on change. The expectation in a popover or dialog is to explicitly Cancel or Save and I'd think the only way to improve the user experience and interaction is by adding Cancel and Save buttons.

A few screenshots of this design pattern in some of the editor popovers:

trunk

status and visibility

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

afercia commented 2 weeks ago

Note: the Excerpt popover is a special case. When testing, you will notice that changes to the excerpt are saved only after tabbing away from the textarea (onblur). This is inconsistent with other popovers and is even more disorienting. When pressing Escape after a change and with the keyboard focus still in the textarea, the changes are not saved.

Noting that the Excerpt pattern is used also for editing other properties e.g. the Template description. Screenshot:

Screenshot 2024-07-12 at 10 55 51

roygbyte commented 2 weeks ago

Would these dialogs benefit from a "revert" action?