Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14740 closed bug (notabug)

'focus' event is not being triggered on elements that are no attached to the document

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:


Test case: http://jsfiddle.net/DtVq7/1/

Add a 'focus' event listener on an input that's not part of the DOM, trigger 'focus' on it, the callback is not getting fired. When you attach it to the DOM and trigger 'focus' again the callback will get fired. 'blur' works for both cases.

Change History (2)

comment:1 Changed 9 years ago by [email protected]

This is happening on all browsers, on Firefox 26 none of the 'focus' cases works.

Version 2, edited 9 years ago by [email protected] (previous) (next) (diff)

comment:2 Changed 9 years ago by dmethvin

Resolution: notabug
Status: newclosed

It doesn't make sense to "focus" an element not in a document. If you want to just call its handlers, use .triggerHandler().

Note: See TracTickets for help on using tickets.