diff --git a/web/src/invite_stream_picker_pill.ts b/web/src/invite_stream_picker_pill.ts index 07a5116f5f..39277c61c9 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 9ed7522b12..e9cb88ce14 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); },