Test Javascript enter-key activation on all browsers

Description

The Lightbox code that responds to the Enter key needs to be tested on all browsers.

We also need todecide whether or not we want to map the Space bar to the same activation.

The code needs to be cleaned up and refactored (e.g. eliminate dependence on lightbox.domNode).

Environment

None

Attachments

1

is depended on by

Activity

Show:

Colin Clark March 11, 2008 at 7:57 PM

Fixed in r4723 by removing the dependency on lightbox.domNode and using the event's target instead.

Jonathan Hung March 6, 2008 at 4:08 PM

I wasn't sure how we can guarantee that the evt.target is the activeItem, so I did some looking.

According to Quirksmode: http://www.quirksmode.org/js/events_properties.html#target

"Even if an event is captured or bubbles up, the target/srcElement always remains the element the event took place on."

Good to know.

Colin Clark March 5, 2008 at 8:57 PM

Here's an option that gets rid of dependence on the activeItem completely, since we can guarantee that evt.target is the activeItem. I also changed the code to take the Lighbox's container element rather than the lightbox itself. This is your #2 option, Jonathan.

This is just a start. The code could be further cleaned up. One of my concerns is the way we search for any anchors within the event's target and just activate the first. Works reasonably for the Lightbox, but we could also choose to key of a known ID on one of the hyperlinks.

I've only tested this in FF3. Please test it more widely and let me know what you think.

Jonathan Hung March 5, 2008 at 8:09 PM

Too hasty in closing bug. Re-opened due to my confusion about removing the dependency on lightbox.domNode.

Jonathan Hung March 5, 2008 at 6:43 PM

On FF2 and FF3 on OS X, the Enter key activates the link as expected. Space bar does not appear to do anything unlike on Windows.

Fixed

Details

Assignee

Reporter

Original estimate

Time tracking

1h 30m logged6h 30m remaining

Components

Fix versions

Affects versions

Priority

Created February 19, 2008 at 5:53 PM
Updated April 28, 2008 at 7:27 PM
Resolved March 11, 2008 at 7:57 PM

Flag notifications