fix Dialog (form) submit behaviour on Enter

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-08-10 10:23:13 +02:00
parent f91cead9f1
commit c232bc1d59
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0

View File

@ -32,7 +32,7 @@
</script>
<div class="container">
<form class="dialog">
<form class="dialog" on:submit|preventDefault={() => { okAction(); dispatch('close') }}>
<div class="header">
<div class="title"><Label {label}/></div>
<div class="tool" on:click={() => { dispatch('close') }}><Close size={'small'}/></div>
@ -41,8 +41,8 @@
<ScrollBox vertical gap={0}><slot/></ScrollBox>
</div>
<div class="footer">
<Button label={okLabel} primary on:click={() => { okAction(); dispatch('close') }}/>
<Button label={'Cancel'} on:click={() => { okAction(); dispatch('close') }}/>
<Button label={okLabel} primary/>
<Button label={'Cancel'} on:click={() => { dispatch('close') }}/>
</div>
</form>
</div>