recent_topics: Don't revive focus when user is trying to type.

This commit is contained in:
Aman Agrawal 2021-02-15 14:33:37 +00:00 committed by Tim Abbott
parent 3e36fe6a1e
commit a210ee2b7d
4 changed files with 9 additions and 3 deletions

View File

@ -78,6 +78,12 @@ function revive_current_focus() {
// After re-render, the current_focus_elem is no longer linked // After re-render, the current_focus_elem is no longer linked
// to the focused element, this function attempts to revive the // to the focused element, this function attempts to revive the
// link and focus to the element prior to the rerender. // link and focus to the element prior to the rerender.
// Don't change focus if user is trying to type anywhere.
if ($(".home-page-input").is(":focus")) {
return false;
}
if (!current_focus_elem) { if (!current_focus_elem) {
set_default_focus(); set_default_focus();
return false; return false;

View File

@ -71,7 +71,7 @@
<i id="streams_inline_cog" class='fa fa-cog' aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="{{ _('Subscribe, add, or configure streams') }}"></i> <i id="streams_inline_cog" class='fa fa-cog' aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="{{ _('Subscribe, add, or configure streams') }}"></i>
<i id="streams_filter_icon" class='fa fa-search' aria-hidden="true" data-toggle="tooltip" title="{{ _('Filter streams') }} (q)"></i> <i id="streams_filter_icon" class='fa fa-search' aria-hidden="true" data-toggle="tooltip" title="{{ _('Filter streams') }} (q)"></i>
<div class="input-append notdisplayed stream_search_section"> <div class="input-append notdisplayed stream_search_section">
<input class="stream-list-filter" type="text" autocomplete="off" placeholder="{{ _('Search streams') }}" /> <input class="stream-list-filter home-page-input" type="text" autocomplete="off" placeholder="{{ _('Search streams') }}" />
<button type="button" class="btn clear_search_button" id="clear_search_stream_button"> <button type="button" class="btn clear_search_button" id="clear_search_stream_button">
<i class="fa fa-remove" aria-hidden="true"></i> <i class="fa fa-remove" aria-hidden="true"></i>
</button> </button>

View File

@ -31,7 +31,7 @@
<form id="searchbox_form" class="form-search navbar-search"> <form id="searchbox_form" class="form-search navbar-search">
<div id="search_arrows" class="input-append"> <div id="search_arrows" class="input-append">
<span class="search_icon search_open" ><i class="fa fa-search" aria-hidden="true"></i></span> <span class="search_icon search_open" ><i class="fa fa-search" aria-hidden="true"></i></span>
<input class="search-query input-block-level" id="search_query" type="text" placeholder="{{ _('Search') }}" <input class="search-query input-block-level home-page-input" id="search_query" type="text" placeholder="{{ _('Search') }}"
autocomplete="off" aria-label="{{ _('Search') }}" title="{{ _('Search') }} (/)"/> autocomplete="off" aria-label="{{ _('Search') }}" title="{{ _('Search') }} (/)"/>
<button class="btn search_button" type="button" id="search_exit" aria-label="{{ _('Exit search') }}"><i class="fa fa-remove" aria-hidden="true"></i></button> <button class="btn search_button" type="button" id="search_exit" aria-label="{{ _('Exit search') }}"><i class="fa fa-remove" aria-hidden="true"></i></button>
</div> </div>

View File

@ -6,7 +6,7 @@
<i id="user_filter_icon" class='fa fa-search' aria-hidden="true" aria-label="{{ _('Filter users') }}" data-toggle="tooltip" title="{{ _('Filter users') }} (w)"></i> <i id="user_filter_icon" class='fa fa-search' aria-hidden="true" aria-label="{{ _('Filter users') }}" data-toggle="tooltip" title="{{ _('Filter users') }} (w)"></i>
</div> </div>
<div class="input-append notdisplayed" id="user_search_section"> <div class="input-append notdisplayed" id="user_search_section">
<input class="user-list-filter" type="text" autocomplete="off" placeholder="{{ _('Search people') }}" /> <input class="user-list-filter home-page-input" type="text" autocomplete="off" placeholder="{{ _('Search people') }}" />
<button type="button" class="btn clear_search_button" id="clear_search_people_button"> <button type="button" class="btn clear_search_button" id="clear_search_people_button">
<i class="fa fa-remove" aria-hidden="true"></i> <i class="fa fa-remove" aria-hidden="true"></i>
</button> </button>