Bug Tracker

Opened 5 years ago

Closed 5 years ago

#14740 closed bug (notabug)

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

Reported by: me@… 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.

Change History (2)

comment:1 Changed 5 years ago by me@…

This is happening on all browsers

Last edited 5 years ago by me@… (previous) (diff)

comment:2 Changed 5 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.