From 59fd18d657fcd50b32c56c8769c39a283354a9ab Mon Sep 17 00:00:00 2001 From: Jarmo Pertman Date: Tue, 3 Mar 2020 05:12:55 +0200 Subject: [PATCH] Clear filtered secrets list when deleting filter --- assets/js/auto_suggest.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/auto_suggest.js b/assets/js/auto_suggest.js index 9f380f9..6c4439c 100644 --- a/assets/js/auto_suggest.js +++ b/assets/js/auto_suggest.js @@ -2,7 +2,9 @@ function AutoSuggest() { var search = defer(function(event) { var target = event.target if (target.id === "filter") { - target.closest("form").querySelector("input[type='submit']").click() + var form = target.closest("form") + if (!target.value) document.querySelector(form.dataset.container).innerHTML = "" + form.querySelector("input[type='submit']").click() } })