mirror of https://github.com/zulip/zulip.git
typeahead: Hide typeahead on clicking outside after clicking its header.
Until now, the typeahead was hidden on clicking outside only if the last click was not on the header. This happened because clicking the header would blur the input, and any other click then would not trigger the blur event (which is responsible for hiding the typeahead). Now we refocus the input after clicking the header, so that clicking elsewhere blurs the input and hides the typeahead.
This commit is contained in:
parent
449febf036
commit
f1ec9e139f
|
@ -495,6 +495,11 @@ import {get_string_diff} from "../../src/util";
|
|||
setTimeout(function () {
|
||||
if (!that.$container.is(':hover')) {
|
||||
that.hide();
|
||||
} else if (that.shown) {
|
||||
// refocus the input if the user clicked on the typeahead
|
||||
// so that clicking elsewhere registers as a blur and hides
|
||||
// the typeahead.
|
||||
that.$element.focus();
|
||||
}
|
||||
}, 150)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue