Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

invite_stream_picker_pill: Hide typeahead after backspacing a pill.

Sanchit Sharma6dba4cf94336
diff --git a/web/src/invite_stream_picker_pill.ts b/web/src/invite_stream_picker_pill.ts
index 07a5116f5f3..39277c61c98 100644
--- a/web/src/invite_stream_picker_pill.ts
+++ b/web/src/invite_stream_picker_pill.ts
@@ -28,6 +28,7 @@ function create_item_from_stream_name(
function set_up_pill_typeahead({pill_widget, $pill_container}: SetUpPillTypeaheadConfig): void {
const opts = {
help_on_empty_strings: true,
+ hide_on_empty_after_backspace: true,
invite_streams: true,
};
set_up_stream($pill_container.find(".input"), pill_widget, opts);
diff --git a/web/src/pill_typeahead.ts b/web/src/pill_typeahead.ts
index 9ed7522b122..e9cb88ce14b 100644
--- a/web/src/pill_typeahead.ts
+++ b/web/src/pill_typeahead.ts
@@ -76,6 +76,7 @@ export function set_up_stream(
pills: StreamPillWidget,
opts: {
help_on_empty_strings?: boolean;
+ hide_on_empty_after_backspace?: boolean;
invite_streams?: boolean;
update_func?: () => void;
},
@@ -85,9 +86,11 @@ export function set_up_stream(
type: "contenteditable",
};
opts.help_on_empty_strings ??= false;
+ opts.hide_on_empty_after_backspace ??= false;
new Typeahead(bootstrap_typeahead_input, {
dropup: true,
helpOnEmptyStrings: opts.help_on_empty_strings,
+ hideOnEmptyAfterBackspace: opts.hide_on_empty_after_backspace,
source(_query: string): StreamPillData[] {
return stream_pill.typeahead_source(pills, opts.invite_streams);
},