How to detect focusOut of entire component in Emberjs?

Posted by Andre Scott | Updated on

Want to detect focusOut of entire component in Emberjs? Run the code in a new runloop using Em.run.later. Here is the sample of a code for one my addons. I am hiding a dropdown menu when focus goes out of the component.

Running the code in a separate runloop will ensure that you will get the document.activeElement correctly.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers