Make Select work how one would expect in forms

This commit is contained in:
MathMan05 2024-08-27 14:01:17 -05:00
parent 61fa001daf
commit b2c0adec68
2 changed files with 8 additions and 0 deletions

View file

@ -793,6 +793,10 @@ class Form {
if (thing === "") if (thing === "")
continue; continue;
const input = this.names.get(thing); const input = this.names.get(thing);
if (input instanceof SelectInput) {
build[thing] = input.options[input.value];
continue;
}
build[thing] = input.value; build[thing] = input.value;
} }
if (this.fetchURL !== "") { if (this.fetchURL !== "") {

View file

@ -794,6 +794,10 @@ class Form implements OptionsElement<object>{
for(const thing of this.names.keys()){ for(const thing of this.names.keys()){
if(thing==="") continue; if(thing==="") continue;
const input=this.names.get(thing) as OptionsElement<any>; const input=this.names.get(thing) as OptionsElement<any>;
if(input instanceof SelectInput){
build[thing]=input.options[input.value];
continue;
}
build[thing]=input.value; build[thing]=input.value;
} }
if(this.fetchURL!==""){ if(this.fetchURL!==""){