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.

search pills: Fix high cursor and no placeholder for empty input.

evykassirere3f85e5cfe54
diff --git a/web/src/search.ts b/web/src/search.ts
index 11a4e1d5644..190c604f13c 100644
--- a/web/src/search.ts
+++ b/web/src/search.ts
@@ -210,6 +210,16 @@ export function initialize({on_narrow_search}: {on_narrow_search: OnNarrowSearch
}
});
+ // Firefox leaves a <br> child element when the user enters search
+ // input and then removes it, which breaks the :empty placeholder
+ // text, so we need to manually remove it.
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1513303
+ $("#search_query").on("input", () => {
+ if (get_search_bar_text() === "") {
+ $("#search_query").empty();
+ }
+ });
+
// register searchbar click handler
$("#search_exit").on("click", (e: JQuery.ClickEvent): void => {
exit_search({keep_search_narrow_open: false});