mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
recent_topics: Select the filter text on lauch.
This will allow users to easily search for new topics without losing the last filtered text.
This commit is contained in:
@@ -318,11 +318,20 @@ run_test("test_recent_topics_launch", () => {
|
||||
return '<recent_topics table stub>';
|
||||
});
|
||||
|
||||
$("#recent_topics_search").selected = false;
|
||||
$("#recent_topics_search").select = () => {
|
||||
$("#recent_topics_search").selected = true;
|
||||
};
|
||||
|
||||
const rt = zrequire('recent_topics');
|
||||
rt.process_messages(messages);
|
||||
|
||||
assert.equal($("#recent_topics_search").selected, false);
|
||||
|
||||
rt.launch();
|
||||
assert.equal($("#recent_topics_search").is(":focus"), true);
|
||||
|
||||
// Test if search text is selected
|
||||
assert.equal($("#recent_topics_search").selected, true);
|
||||
overlays.close_callback();
|
||||
|
||||
// incorrect topic_key
|
||||
|
||||
@@ -349,7 +349,7 @@ exports.launch = function () {
|
||||
},
|
||||
});
|
||||
exports.complete_rerender();
|
||||
$("#recent_topics_search").focus();
|
||||
$("#recent_topics_search").select();
|
||||
};
|
||||
|
||||
window.recent_topics = exports;
|
||||
|
||||
Reference in New Issue
Block a user