mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: pressing enter in a modal now trigger the submission
This commit is contained in:
1 parent
0cf9fcef47
commit
6a1dd88b24
1 file changed
+11
-1
@@ -19,11 +19,19 @@
|
||||
export let hideFooter = false;
|
||||
|
||||
let alert: HTMLElement;
|
||||
let formComponent: Form;
|
||||
|
||||
beforeNavigate(() => {
|
||||
show = false;
|
||||
});
|
||||
|
||||
function handleKeydown(event: KeyboardEvent) {
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
formComponent.triggerSubmit();
|
||||
}
|
||||
}
|
||||
|
||||
$: $disableCommands(show);
|
||||
|
||||
$: if (error) {
|
||||
@@ -31,7 +39,9 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Form isModal {onSubmit}>
|
||||
<svelte:window on:keydown={handleKeydown} />
|
||||
|
||||
<Form isModal {onSubmit} bind:this={formComponent}>
|
||||
<Modal {title} bind:open={show} {hideFooter}>
|
||||
<svelte:fragment slot="description">
|
||||
<slot name="description" />
|
||||
|
||||
Reference in new issue
Block a user