Skip to content

Commit c65f85d

Browse files
NewSoupViJames Schurig
authored andcommitted
WebHost: Fix "Add" button for custom option values causing a weird redirect (ArchipelagoMW#3518)
* WebHost: Fix "Add" button for Progression Balancing causing a weird redirect This "add" button is part of a form, which causes it to submit the form, because the default type for a button is "submit". This PR changes the type of the button to "button", which causes it to not submit the form and just execute its normal effect. (An alternative would be `event.preventDefault()` but that seems less clean to me, but also I'm not a HTML/JS dev) * There's also multiple.
1 parent c3fec99 commit c65f85d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

WebHostLib/templates/weightedOptions/macros.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
{% endif %}
4848
<div class="add-option-div">
4949
<input type="number" class="range-option-value" data-option="{{ option_name }}" />
50-
<button class="add-range-option-button" data-option="{{ option_name }}">Add</button>
50+
<button type="button" class="add-range-option-button" data-option="{{ option_name }}">Add</button>
5151
</div>
5252
</div>
5353
<table class="range-rows" data-option="{{ option_name }}">
@@ -72,7 +72,7 @@
7272
This option allows custom values only. Please enter your desired values below.
7373
<div class="custom-value-wrapper">
7474
<input class="custom-value" data-option="{{ option_name }}" placeholder="Custom Value" />
75-
<button data-option="{{ option_name }}">Add</button>
75+
<button type="button" data-option="{{ option_name }}">Add</button>
7676
</div>
7777
<table>
7878
<tbody>
@@ -89,7 +89,7 @@
8989
Custom values are also allowed for this option. To create one, enter it into the input box below.
9090
<div class="custom-value-wrapper">
9191
<input class="custom-value" data-option="{{ option_name }}" placeholder="Custom Value" />
92-
<button data-option="{{ option_name }}">Add</button>
92+
<button type="button" data-option="{{ option_name }}">Add</button>
9393
</div>
9494
</div>
9595
<table>

0 commit comments

Comments
 (0)