Skip to content

Commit 0dbf9e1

Browse files
committed
Added type="button" in jschema components to avoid automatic form submission
1 parent e64923a commit 0dbf9e1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/lib/components/common/jschema/ArrayProperty.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@
4747
<div id='{collapseSymbol}' class='accordion-collapse collapse' data-bs-parent='#{accordionParentKey}'>
4848
<div class='accordion-body p-1'>
4949
<div class='d-flex justify-content-center p-2'>
50-
<button class='btn btn-primary' on:click={addNestedProperty}>Add argument to list</button>
50+
<button class='btn btn-primary' type="button" on:click={addNestedProperty}>Add argument to list</button>
5151
</div>
5252
<div>
5353
{#each nestedProperties as nestedProperty, index (nestedProperty.key)}
5454
<div class='d-flex'>
5555
<div class='align-self-center m-2'>
56-
<button class='btn btn-warning' on:click={removeNestedProperty(index)}>Remove</button>
56+
<button class='btn btn-warning' type="button" on:click={removeNestedProperty(index)}>Remove</button>
5757
</div>
5858
<div class='flex-fill'>
5959
<PropertyDiscriminator schemaProperty={nestedProperty} />

src/lib/components/common/jschema/ObjectProperty.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<input type='text' bind:value={customObjectPropertyKey} placeholder='Key' class='form-control'>
5959
</div>
6060
<div class='col-6'>
61-
<button class='btn btn-primary' on:click={addNestedObjectProperty}>Add property</button>
61+
<button class='btn btn-primary' type="button" on:click={addNestedObjectProperty}>Add property</button>
6262
</div>
6363
</form>
6464
</div>

src/lib/components/common/jschema/PropertiesBlock.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{#if parsedProperties}
2727
{#each blockProperties as prop}
2828
{#if removePropertyBlock }
29-
<button class='btn btn-danger' on:click={removePropertyBlock.bind(this, prop.key)}>Remove Property Block
29+
<button class='btn btn-danger' type="button" on:click={() => removePropertyBlock(prop.key)}>Remove Property Block
3030
</button>
3131
{/if}
3232
<PropertyDiscriminator schemaProperty={prop}></PropertyDiscriminator>

0 commit comments

Comments
 (0)