Skip to content

Commit

Permalink
Input works on radio buttons now
Browse files Browse the repository at this point in the history
  • Loading branch information
lemniscate8 committed Aug 4, 2021
1 parent 5db885f commit 8f649f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/emp/web/Input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ namespace web {
Info()->callback_id = JSWrap( std::function<void(std::string)>( [b_info](std::string new_val){b_info->DoChange(new_val);} ) );
Info()->onchange_info = emp::to_string("emp.Callback(", Info()->callback_id, ", ['checkbox', 'radio'].includes(this.type) ? this.checked.toString() : this.value);");
// Allows user to set the checkbox to start out on/checked
if (in_type.compare("checkbox") == 0 && is_checked){
if ((in_type.compare("checkbox") == 0 || in_type.compare("radio") == 0) && is_checked) {
this->SetAttr("checked", "true");
}
}
Expand Down

0 comments on commit 8f649f3

Please sign in to comment.