From 6f86ade887b37cbadbecc8b4fba8e9989b00df4a Mon Sep 17 00:00:00 2001 From: Ali Abid Date: Thu, 2 Jul 2020 15:24:00 -0700 Subject: [PATCH] radio select first --- gradio/static/js/interfaces/input/radio.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradio/static/js/interfaces/input/radio.js b/gradio/static/js/interfaces/input/radio.js index 5f18ca1d27..f03d55d654 100644 --- a/gradio/static/js/interfaces/input/radio.js +++ b/gradio/static/js/interfaces/input/radio.js @@ -11,15 +11,15 @@ const radio = { } html += "" this.target.html(html); + this.target.find("input:first-child").prop("checked", true); }, submit: function() { checked_val = this.target.find("input:checked").val(); - if (checked_val) { - this.io_master.input(this.id, this.choices[checked_val]); - } + this.io_master.input(this.id, this.choices[checked_val]); }, clear: function() { this.target.find("input").prop("checked", false); + this.target.find("input:first-child").prop("checked", true); }, load_example: function(data) { let child = this.choices.indexOf(data) + 1;