Skip to content

Commit

Permalink
Merge pull request #6 from Erkam246/patch-1
Browse files Browse the repository at this point in the history
Fix default dropdownIndex
  • Loading branch information
ApocalypsjeNL authored Aug 4, 2021
2 parents 15e85a5 + 7810e5a commit 7015f8c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public JsonObject getJsonData() {
this.jsonObject.add("options", new JsonArray());
if(!this.dropdownOptions.isEmpty()) {
this.dropdownOptions.forEach(this.jsonObject.getAsJsonArray("options")::add);
this.jsonObject.addProperty("defaultOptionIndex", this.defaultOptionIndex);
this.jsonObject.addProperty("default", this.defaultOptionIndex);
} else {
this.jsonObject.getAsJsonArray("options").add("No options provided.");
this.jsonObject.addProperty("defaultOptionIndex", 0);
this.jsonObject.addProperty("default", 0);
}
return this.jsonObject;
}
Expand All @@ -105,8 +105,8 @@ public JsonObject getJsonData() {
public String toString() {
return "ElementDropdown{" +
"elementText='" + this.elementText + '\'' +
", dropdownOptions=" + this.dropdownOptions +
", defaultOptionIndex=" + this.defaultOptionIndex +
", options=" + this.dropdownOptions +
", default=" + this.defaultOptionIndex +
", jsonObject=" + this.jsonObject +
", elementId='" + this.elementId + '\'' +
", elementType=" + this.elementType +
Expand Down

0 comments on commit 7015f8c

Please sign in to comment.