Opened 12 years ago
Last modified 9 days ago
#15631 reopened enhancement
Custom fields auto-focus
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Editor | Keywords: | has-patch has-ux-feedback needs-testing |
Focuses: | ui, accessibility | Cc: |
Description
When you are on the post editor (page editor, whatever), if you want to create a new custom field and click on Create New, it should auto-focus on the text input field that appears.
Attachments (5)
Change History (22)
This ticket was mentioned in Slack in #design by karmatosed. View the logs.
6 years ago
#5
@
6 years ago
- Keywords has-ux-feedback added; ux-feedback removed
I agree that the input should revert once custom field is added, without cancel link. If this is still an issue it will need a patch check due to age.
I am tackling this during weekly ux-feedback triage.
#6
@
20 months ago
- Focuses accessibility added
Changing the focus behavior might help, yet I'm more concerned about the lack of a label on the meta key input field. So even if you think to use Shift + Tab
to go back to the meta key input, a screen reader cannot say what you are editing.
#7
@
12 months ago
Maybe I am missing something here, but would not adding a text input on the list of options to either search existing fields or writing the name of a new one to add eliminate the need to have that dual UI with that confusing New/Cancel pattern?
It would be similar to the existing UI for links, with the added option to 'Create new' when no result is found. (Quick mockup for clarity: https://drive.google.com/file/d/1VvPlU_j5aXDTN445CkeMmGNpBk2dVko8/view?usp=sharing)
This ticket was mentioned in Slack in #accessibility by franrosa. View the logs.
12 months ago
#9
@
12 months ago
- Keywords needs-refresh removed
This is a feature of the classic editor that the block editor adopted. There was some trouble creating a custom fields UI element there in the months before WordPress 5.0, which could be easier now. Discussion about an element like the block editor's link autocomplete would fit better in the Gutenberg repo.
Yet your suggestion led me to think about the native datalist element. Firefox still has a bug with the dropdown, but the element could be worth considering.
15631-datalist.diff
- Replaces
select
with adatalist
of the same options - Uses the "Name" table header as the label for the input field
- Removes the "Enter New"/"Cancel" toggle link
- Would need CSS editing for the dropdown triangle position
I also created 15631.2.diff to follow prior feedback:
- Ensures that the "Name" table header as the label for the select element
- Creates a "New custom field name" ARIA label for the input field
- Converts the toggle link to a button
- Moves focus to the input after clicking "Enter New", and to the select after "Cancel" or "Add Custom Field"
- Keeps the JS inline (I would have added it to post.js, but the block editor apparently does not load it)
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
5 months ago
#11
@
3 months ago
- Milestone changed from Future Release to 6.3
- Owner set to joedolson
- Status changed from new to accepted
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
3 months ago
#13
@
3 months ago
- Keywords needs-testing added
We reviewed this ticket today during the Accessibility Team's bug scrub.
The ticket needs testing to check if patch 15631.2.diff still applies clearly or if a refresh is needed.
#14
@
8 weeks ago
- Resolution set to invalid
- Status changed from accepted to closed
Test Report
This report validates that the issue is still reproduced.
Patch tested: https://core.trac.wordpress.org/ticket/15631
Environment
OS: macOS 13.1
Web Server: Nginx
PHP: 8.0
WordPress: 6.3
Browser: Chrome 111.0.5563.146
Active Plugins:
Classic Editor
Actual Results
The issue was not resolved with a patch.
Additional Notes
Steps to reproduce:
Install and activate Classic Editor
Open any post/page
Open 'Screen options
Enable 'Custom fields'
Add custom field
Observe where is the focus
Add Inline:
Actual result: It's not auto-focused on the text input field that appears.
Expected result: It should auto-focus on the text input field that appears.
#16
@
12 days ago
Note: the test by @annashopina looks like it was testing whether focus was moved when using the 'Add Custom Field' button, but this ticket is about moving focus to the text field when 'Enter New' is chosen to define a new custom field name. So that test isn't valid.
I just tested, and the patch tests fine. I'm uploading two patches; 15631.3.diff is a refresh of the previous patch, 15631.4.diff changes the 'Enter new' button to use the button-small appearance (matching the delete/update buttons on existing fields & avoiding the semantic confusion of something that is a button but looks like a link) and moves the 'Add Custom Field' button out of the table, because the semantics don't make sense.
Moved inline javascript to post.dev.js and set the field to auto-focus.
Should the input be reverted back to the select once a new custom field is added? It just seems weird (possibly confusing) because of the "cancel" link.