mirror of https://github.com/zulip/zulip.git
typeahead: Don't hide typeahead on blur if focus is back in the input.
Now we don't hide the typeahead if the focus is back in the input within 150 ms. This is common when using the compose formatting buttons, which only momentarily take the focus away from the input. This is a prep commit for the next, to show typeahead on adding code syntax with the code formatting button.
This commit is contained in:
parent
fb25027cfb
commit
4f051d653c
|
@ -585,7 +585,10 @@ Typeahead.prototype = {
|
|||
return;
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!this.$container.is(":hover")) {
|
||||
if (!this.$container.is(":hover") && !this.$element.is(":focus")) {
|
||||
// We do not hide the typeahead in case it is being hovered over,
|
||||
// or if the focus is immediately back in the input field (likely
|
||||
// when using compose formatting buttons).
|
||||
this.hide();
|
||||
} else if (this.shown) {
|
||||
// refocus the input if the user clicked on the typeahead
|
||||
|
|
Loading…
Reference in New Issue