Popover without loosing focus


I’m trying to implement some text input which recognizes special tags and offers some tags as auto completion. (think about it being similar as twitter hashtags: You type in a special sign, e.g. “#” followed by 2 or more characters, and the app presents suggestions from a list while typing).

I tried to implement it using a popover shown on top of the textarea when the pattern is recognized, but when I present the popover it catches the focus, although I do not want to remove the focus of the current textarea. The user shall be able to continue typing and optionally select an entry from the suggestions.

Is there any way to prevent the popover from receiving focus?
Alternatively, I could just position a div on top of the element manually, but then I need to know how to catch the “back” button and clicks outside of the div on any other element so I am able to close it in this cases…

Any ideas?



Have you ever figured it out?