From b7e9c1a3e44c986e740bf40222a98ea809dbb2f2 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 5 Dec 2018 11:24:16 +0000 Subject: [PATCH] Always show checked items in live search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you’ve searched to select an item and then you want to perform an action on it it’s confusing when it goes away if you change your search. It should always be clear which items you’re performing an action on. This means that checked items should always be visible, no matter what your search term is. --- app/assets/javascripts/liveSearch.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/javascripts/liveSearch.js b/app/assets/javascripts/liveSearch.js index 0968156c0..240b84114 100644 --- a/app/assets/javascripts/liveSearch.js +++ b/app/assets/javascripts/liveSearch.js @@ -11,6 +11,11 @@ let content = $('.live-search-relevant', this).text() || $(this).text(); + if ($(this).has(':checked').length) { + $(this).show(); + return; + } + if (query == '') { $(this).css('display', ''); return;