From e7c116738fabe04a97db362b91315ac7fc3f81ea Mon Sep 17 00:00:00 2001
From: Bryan Brancotte <bryan.brancotte@pasteur.fr>
Date: Thu, 3 Feb 2022 16:39:57 +0100
Subject: [PATCH] Ignore option with empty value i.e: the default one closes
 #242

---
 .../viralhostrangedb/static/js/virus_or_host_detail.js          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/viralhostrange/viralhostrangedb/static/js/virus_or_host_detail.js b/src/viralhostrange/viralhostrangedb/static/js/virus_or_host_detail.js
index fb84c094..9e9beaea 100644
--- a/src/viralhostrange/viralhostrangedb/static/js/virus_or_host_detail.js
+++ b/src/viralhostrange/viralhostrangedb/static/js/virus_or_host_detail.js
@@ -24,7 +24,7 @@ $(document).ready(function(){
                 .parentNode
                 .querySelectorAll('[for="'+radio_id+'"]')
                 .forEach(e => e.parentNode.removeChild(e));
-            if(e.target.id != radio_id){
+            if(e.target.value != ''){
                 add_badge(radio_id, e.target.parentNode.querySelectorAll("label")[0].textContent);
             }
         }else{
-- 
GitLab