Skip to main content

Bug Tracker

Side navigation

#14740 closed bug (notabug)

Opened January 30, 2014 05:49AM UTC

Closed February 24, 2014 03:27PM UTC

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

Reported by: me@mario.ec Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:
Description

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.

Attachments (0)
Change History (2)

Changed January 30, 2014 06:02AM UTC by me@mario.ec comment:1

_comment0: This is happening on all browsers, on Firefox 26 none of the 'focus' cases works.1391061894161911
_comment1: *deleted* (modified original post)1391061920117267
_comment2: This is happening on all browsers, on Firefox 26 none of the 'focus' cases works.1391153946767950

This is happening on all browsers

Changed February 24, 2014 03:27PM UTC by dmethvin comment:2

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().