Skip to content

Commit

Permalink
Fix: not saves numeric values
Browse files Browse the repository at this point in the history
  • Loading branch information
haoling authored and growse committed Jun 17, 2024
1 parent 59a5a06 commit a3154df
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@
if (this.getAttribute("type") === "checkbox") {
config[this.id] = this.checked;
} else if (this.getAttribute("type") === "text") {
config[this.id] = this.value;
// get configu value type
let type = typeof (config[this.id]);
if (type === "number") {
config[this.id] = parseInt(this.value, 10);
} else {
config[this.id] = this.value;
}
} else if (this.localName === "select") {
let maybeNumeric = parseInt(this.value, 10);
if (isNaN(maybeNumeric)) {
Expand Down

0 comments on commit a3154df

Please sign in to comment.