recreate object warning

This commit is contained in:
Jan Prochazka
2021-09-16 10:48:46 +02:00
parent 3ca0810756
commit e715a95cc0
8 changed files with 75 additions and 19 deletions

View File

@@ -3,6 +3,8 @@
import { getFormContext } from './FormProviderCore.svelte';
import { createEventDispatcher } from 'svelte';
export let disabled;
const dispatch = createEventDispatcher();
const { submitActionRef } = getFormContext();
@@ -13,8 +15,10 @@
}
submitActionRef.set(() => {
handleClick();
if (!disabled) {
handleClick();
}
});
</script>
<FormStyledButton type="submit" on:click={handleClick} {...$$props} />
<FormStyledButton type="submit" {disabled} on:click={handleClick} {...$$props} />