Ticket #2531334 (closed defect)

Reporter


Todd Kloots
Opened: 10/25/11
Last modified: 05/10/12
Status: closed
Type: defect
Resolution: fixed

Owner


Luke Smith
Target Release: 3.5.0
Priority: P3 (normal)
Summary: Regression in ability to delegate focus and blur events
Description:

As of YUI 3.2.0 when you use delegate() with focus and blur events, and the delegation selector specifies a non-focusable element the listener won't get called.

Type: defect Observed in Version: 3.2.0
Component: Event Severity: S3 (normal)
Assigned To: Luke Smith Target Release: 3.5.0
Location: Library Code Priority: P3 (normal)
Tags: event delegate focus blur Relates To:
Browsers: Safari - All,IE - All
URL:
Test Information:

Attachments

Attachment #1: focus-bug-repro.html (download)

Change History

Luke Smith

YUI Contributor

Posted: 10/25/11
  • milestone changed to 3.5.0
  • status changed from new to accepted

Luke Smith

YUI Contributor

Posted: 01/31/12
  • estimated changed from 0 to 1
  • remaining changed from 0 to 1
  • sprint changed to sprint 3

I glanced over the code and didn't see anything that stood out.....until just now as I type. It's probably the reliance on the actual focus and blur events, since they won't be emitted by the non-focusable elements.

When you say you're delegating on a non-focusable element, can be more specific? As in a <span> or <div> without a tabindex? Or even one with a tabindex?

Todd Kloots

YUI Contributor

Posted: 01/31/12

Yeah - a <span> or a <div> without a tabIndex. The use case is the delegation selector specifies an element that is the parent of an element that is actually focusable/the real target of the focus or blur event. Say, as in the attached example, for the purpose of styling you've got a <span> or two wrapping a button. And so your delegation selector is the outmost <span> for the purpose of toggling a class on that span when the button inside it receives focus. Does that help clarify?

Luke Smith

YUI Contributor

Posted: 03/2/12
  • resolution changed to fixed
  • status changed from accepted to checkedin

Rewrite the notification logic for focus/blur

It was relying on the function returned from Y.delegate.compileFilter
to prefilter delegate subscribers, but that only applied the filter
to the target node, not to its parent axis.

I had to move the filter test into the notification phase and do a
lot of work to maintain notification order matching pseudo-bubbling +
subscription order.

Fixes #2531334
View Commit: 6d973d566c636d39df9f3384aa8123ced5dfc444

Luke Smith

YUI Contributor

Posted: 03/2/12
  • completed changed from 0 to 1
  • remaining changed from 1 to 0

Jenny Donnelly

YUI Developer

Posted: 05/10/12
  • status changed from checkedin to closed

checkedin -> closed