When a user selects a new formatter the formatter select control loses focus. When selecting new formatters with JAWS 11.0.1467 and FF 3.6.10 focus is consistently moved back to the top of the Manage displays table (just before the 'show weights' link).

This means that the user has to find their place in the table again, and posibly loses context for the settings configuration form for the newly selected formatter.

Comments

yoroy’s picture

Not to put a value or priority on this, but out of interest: how many tabs/clicks does this throw people back?

Everett Zufelt’s picture

Title: When selecting a new formatter focus context is lost » When selecting a new formatter or editing settings focus context is lost

@yoroy

It depends on how many fields are in your content-type. But roughly 1 + 3n, where n is the nth field in the table.

E.g. if you are on the 4th field in the table you are looking at about 13 tabs to get back to where you started.

Note, this happens when clicking the 'edit' button to edit the formatter settings as well.

mgifford’s picture

What type of URL are you on? I'm not sure what type of page this is and what action is throwing of the focus.

Everett Zufelt’s picture

@mgifford

On the Manage display page for a content type.

e.g.

admin/structure/types/manage/page/display

mgifford’s picture

Ok, I've confirmed that this is a problem for keyboard only users (least in FF). When I'm reviewing it it seems to hit the autocomplete when I edit the Format select box.

Now why is jquery being called and the table being redrawn when one of these options is selected anyways:
Default, Plain text, Trimmed, Summary or trimmed, Hidden

I'm not sure how to fix this mind you.

Everett Zufelt’s picture

@mgifford

There is an ajax callback when you change formatters to get the returned value from hook_field_formatter_settings_summary(). The hook returns a summary of the settings for the formatter.

yched’s picture

It's possibly a larger issue with ajax-updated forms : if the ajax-refreshed part includes the triggering element (as is the case on the "Manage display" form, the whole table is refreshed), then focus is lost - because the element is in fact a 'new' element.

No time to investigate right now, but it might be worth considering a fix on the ajax framework level...

mgifford’s picture

Issue tags: +Ajax, +ajax form

adding tags

Everett Zufelt’s picture

So, a possible solution would be to save the id of the field with focus (can we even do this?), then replace the form, then if the id still exists in the DOM set focus back to that element.

yched’s picture

Problem is, if the triggering element is part of the HTML refreshed by the ajax call, the 'new' element will have a different id (e.g edit-foo--2 instead of edit-foo)

Everett Zufelt’s picture

Is there any programmatic way that we can accomplish this? It isn't critical, but it is certainly annoying and disorienting

sun.core’s picture

Component: field_ui.module » ajax system
Priority: Major » Normal
Issue tags: -Ajax, -ajax form

Should definitely be fixed at the AJAX framework level. However, that's going to be quite a challenge, since we basically need to capture the xpath from the wrapping AJAX element before performing the AJAX request, and after invoking AJAX commands, check whether we can reach the element captured in the xpath again, and if so, move focus to it.

rfay’s picture

subscribe

mgifford’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7

Bouncing this to D8 & marking it for back porting.

bowersox’s picture

Status: Active » Closed (cannot reproduce)

Everett Zufelt just found that he could not reproduce the issue at this time. We are not sure whether it is truly fixed, but closing for now. If anyone has evidence of this problem still happening, please advise.