Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294474

AJAX focus does not work with multiple forms of the same type

$
0
0

Problem/Motivation

The Drupal AJAX re-focus logic does not work if the relevant form is instanced multiple times on the same page.

Only the first instance is automatically focused.

Steps to reproduce

On a page with duplicated AJAX forms, in which editing textfield A causes an AJAX callback which re-focuses textfield A afterwards:

  1. edit textfield A in form 2
  2. wait for AJAX callback
  3. expect focus to be in textfield A of form 2, see that the actual focus is in textfield A of form 1

Proposed resolution

Adjust the re-focusing logic to respect the index of the original element. this might break if the AJAX callback causes the page to have a different number of form instances. But I suspect this case does not really happen.

Remaining tasks

  • test
  • implementation
  • review

User interface changes

  • improved accessibility

Viewing all articles
Browse latest Browse all 294474

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>