WP-API / new-list-tables

An experiment in re-writing the post list screen using the REST API.
GNU General Public License v2.0
71 stars 17 forks source link

QuickEdit: saving should happen also when pressing Enter on a focused field #11

Closed afercia closed 7 years ago

afercia commented 7 years ago

One of the native form behaviors is that form submission happens also when pressing the Enter key on some form elements, for example on input fields.

The QuickEdit saving should correctly replicate this native behavior, e.g. when using a keyboard and pressing Enter while the Name, Email, or URL fields are focused.

rmccue commented 7 years ago

So, the way to do this properly is to hook into the onSubmit of the form that the elements belong to. This form should be inside the QuickEdit component.

However, right now in the regular WordPress output, there's a single mega-form that wraps the entire table.

Do you forsee any potential problems from moving the form element into the QuickEdit component?

afercia commented 7 years ago

Hm I think the mega-form in core is there to handle also the search, bulk-actions, selects to filter by type (and in other list tables by date, category, etc.). Since everything works differently here, it should be safe?

rmccue commented 7 years ago

That was my figuring, just wanted to check there wasn't an accessibility reason or anything I was missing. :)