fix closing autocomplete if window last focus in between

This commit is contained in:
Laura Klünder 2017-11-15 15:04:14 +01:00
parent caf5d8c152
commit b8ec4c4437

View file

@ -274,10 +274,10 @@ c3nav = {
$(this).parent().data('lastlocation', null);
}
},
_locationinput_global_focuschange: function () {
_locationinput_global_focuschange: function (e) {
// when focus changed, reset autocomplete if it is outside of locationinputs or autocomplete
if (!c3nav.current_locationinput) return;
if (!$('#autocomplete > :focus, #' + c3nav.current_locationinput + ' > :focus').length) {
if (!$(e.target).is('#autocomplete *, #' + c3nav.current_locationinput + ' *')) {
c3nav._locationinput_reset_autocomplete();
}
},