Codemirror event if hint word not found in autocomplete list ?

I need that word which user tried searching in the autocomplete list and he was not able to find it in the list. I tried doing this with “shown” and “close” events as to start capturing word on “shown” and end capture on “close” event. But “close” event does not work correctly as it only get fired when, we close the hint list dialog manually, but it does not fire when we are searching for the word and its not there and dialog get closed automatically, we do not get any “close” event in this case. So what am i missing here? What would be the correct way to get that word?