compose_typeahead: Ensure header is counted in position calculation.

Previously, there is a bug where the position of the typeahead is off
whenever the user switches from stream typeahead to topic typeahead
in the compose box. The typeahead header was not hidden before
calculation of the position based on container height. These changes
will include the header before calculating for the position.
This commit is contained in:
Joelute 2023-03-24 18:37:55 -04:00 committed by Tim Abbott
parent fa37befe3c
commit edfb2a3948
1 changed files with 8 additions and 8 deletions

View File

@ -199,6 +199,14 @@ import {get_string_diff} from "../../src/util";
}
, show: function () {
var header_text = this.header();
if (header_text) {
this.$header.find('span#typeahead-header-text').html(header_text);
this.$header.show();
} else {
this.$header.hide();
}
var pos;
if (this.fixed) {
@ -230,14 +238,6 @@ import {get_string_diff} from "../../src/util";
, left: pos.left
})
var header_text = this.header();
if (header_text) {
this.$header.find('span#typeahead-header-text').html(header_text);
this.$header.show();
} else {
this.$header.hide();
}
this.$container.show()
this.shown = true
this.mouse_moved_since_typeahead = false