FLUID-2662: In the keyboard-a11y plugin, onLeaveContainer and onUnselect are not called when the user moves focus outside the container of selectables.

Metadata

Source
FLUID-2662
Type
Bug
Priority
Critical
Status
Closed
Resolution
Fixed
Assignee
Colin Clark
Reporter
Colin Clark
Created
2009-05-11T17:18:48.000-0400
Updated
2011-02-28T16:45:16.682-0500
Versions
  1. 0.7
  2. 0.8
  3. 1.0
Fixed Versions
  1. 1.1
Component
  1. Keyboard Accessibility

Description

There's a bug in the keyboard-a11y plugin where neither the onLeaveContainer and onUnselect callbacks are invoked when the user blurs out of the container of selectable elements. Here's the buggy code, starting on line 265 of keyboard-a11y.js:

var cleanUpWhenLeavingContainer = function(selectionContext) {
if (selectionContext.onLeaveContainer) {
selectionContext.onLeaveContainer(
selectionContext.selectables[selectionContext.activeItemIndex]);
} else if (selectionContext.onUnselect) {
selectionContext.onUnselect(
selectionContext.selectables[selectionContext.activeItemIndex]);
}

The reason for this issue is that user-specified callbacks are actually located in the "options" property of the selection context. The code should look like this:

if (selectionContext.options.onLeaveContainer) {
selectionContext.options.onLeaveContainer(
selectionContext.selectables[selectionContext.activeItemIndex]);
} else if (selectionContext.options.onUnselect) {
selectionContext.options.onUnselect(
selectionContext.selectables[selectionContext.activeItemIndex]);
}

I'll write a test to show this issue and then fix.

Comments

  • Colin Clark commented 2009-05-11T17:57:52.000-0400

    I fixed this issue in r7159.

  • Michelle D'Souza commented 2011-02-28T16:45:16.680-0500

    Closing issues that were fixed in 1.1