#473 bug
Robert Sosinski

Form.focusFirstElement activates instad of focuses

Reported by Robert Sosinski | November 29th, 2008 @ 09:54 PM | in After 1.7

Hello,

I notice Form.focusFirstElement both focuses on the first input in a form and highlights its value. On the other hand, Form.Element.focus only focuses on the input field and does not highlight its value, while Form.Element.activate both focuses on the input field and highlights its value.

It seems that Form.focusFirstElement should be called Form.activateFirstElement instead. Maybe having both Form.focusFirstElement and Form.activateFirstElement methods would make for a win/win?

Please let me know your thoughts.

Thanks Gents,

-Robert

Comments and changes to this ticket

  • Juriy Zaytsev

    Juriy Zaytsev November 30th, 2008 @ 06:29 AM

    • Milestone set to 1.7
    • State changed from “new” to “bug”

    It is indeed weird. Documentation also describes this exact behavior (i.e. activate, not focus).

    Was this actually meant to be this way or is it a bug?

    I would be in favor of just "fixing" a method instead of renaming it (to keep the change less obtrusive)

  • Tobie Langel

    Tobie Langel July 23rd, 2009 @ 11:48 PM

    • Tag changed from form, form.element to form
  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 02:01 AM

    • Tag changed from form to section:dom

    [not-tagged:"form" tagged:"section:dom" bulk edit command]

  • T.J. Crowder

    T.J. Crowder November 16th, 2009 @ 04:50 PM

    [responsible:none bulk edit command]

  • Andrew Dupont

    Andrew Dupont October 17th, 2010 @ 10:45 PM

    • Milestone changed from 1.7 to After 1.7
    • Importance changed from “” to “Low”

    Too late to change this behavior for 1.7. I agree that a method named focusFirstElement shouldn't activate the first element, but I'm worried about backward compatibility. This might need to wait until 2.0.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

Pages