typeahead: Fix typeahead showing for disabled inputs.

When user cannot type in the input, because of contenteditable
being set to "false", typeahead should not be shown when clicking
on the input element.

(cherry picked from commit 3739081792)
This commit is contained in:
Sahil Batra
2025-04-14 12:33:17 +05:30
committed by Tim Abbott
parent b61da7d944
commit 6abbbc190c

View File

@@ -834,6 +834,16 @@ export class Typeahead<ItemType extends string | object> {
// when the user clicks anywhere on the input element.
return;
}
if (
this.input_element.type === "contenteditable" &&
this.input_element.$element.prop("contenteditable") === "false"
) {
// We do not want to show the typeahead if user cannot type in
// the input, for cases like user not having required permission.
return;
}
// Update / hide the typeahead menu if the user clicks anywhere
// inside the typing area. This is important in textarea elements
// such as the compose box where multiple typeahead can exist,