Skip to content

Commit

Permalink
fix randomSpec button
Browse files Browse the repository at this point in the history
  • Loading branch information
wonhyukchoi committed Jan 16, 2021
1 parent 8ef8d8e commit 1385308
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/htmlControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ function randInt(min, max) {
function chooseRandOption(selectNode){
const numOptions = selectNode.children.length,
randIdx = randInt(1,numOptions);

if(numOptions === 1)
return "";
return selectNode.children[randIdx].value;
return selectNode.children[0].value;
else
return selectNode.children[randIdx].value;
}

function generateRandSpec(){
Expand Down

0 comments on commit 1385308

Please sign in to comment.