[wp-trac] [WordPress Trac] #29974: Focus handle at wrong place when you click reply

WordPress Trac noreply at wordpress.org
Sat Nov 8 17:25:44 UTC 2014


#29974: Focus handle at wrong place when you click reply
----------------------------------+----------------------------------------
 Reporter:  nhuja                 |       Owner:
     Type:  defect (bug)          |      Status:  new
 Priority:  normal                |   Milestone:  Awaiting Review
Component:  Comments              |     Version:  2.7
 Severity:  normal                |  Resolution:
 Keywords:  has-patch needs-      |     Focuses:  accessibility, javascript
  testing                         |
----------------------------------+----------------------------------------
Changes (by afercia):

 * keywords:   => has-patch needs-testing
 * version:  4.0 => 2.7


Comment:

 To clarify what's currently happening, please refer to the screenshot
 below.
 When you're not logged in:
 - click on Reply
 - focus is moved to the textarea skipping previous form elements

 [[Image(https://cldup.com/tXVZJuMJEl.png)]]

 Sooner or later, users have to focus and fill in the other fields too, so
 why focus the textarea first?
 Screen reader users will be "fooled": when focus gets moved they will
 think there's a good reason for that but they won't realize there are
 other fields before the textarea until they get the error page or unless
 they move around the form.

 Looks like it always worked this way,
 [http://develop.svn.wordpress.org/tags/2.7/wp-includes/js/comment-reply.js
 since 2.7] and never changed, maybe I'm missing something, please let me
 know.

 Form elements are filterable, it's impossible to predict how many fields
 will be there and their order, the proposed patch needs to be as generic
 as possible and just assumes there's at least one `form` element, then:

 - tries to focus the first not-hidden not-disabled form element, whatever
 it is
 - uses scrollIntoView()

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29974#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list