mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-29 14:25:45 +03:00
Modal: Capture keyboard input
This commit is contained in:
parent
9dcbf8b756
commit
b07d2ac61b
@ -11,6 +11,7 @@
|
||||
noPadding?: boolean;
|
||||
onClose?: () => void;
|
||||
onSubmit?: (close: () => void) => void;
|
||||
onKeyDown?: (e: KeyboardEvent) => void;
|
||||
children: Snippet<[item: any, close: () => void]>;
|
||||
controls?: Snippet<[close: () => void, item: any]>;
|
||||
}
|
||||
@ -23,6 +24,7 @@
|
||||
children,
|
||||
controls,
|
||||
onSubmit,
|
||||
onKeyDown,
|
||||
noPadding = false
|
||||
}: Props = $props();
|
||||
|
||||
@ -50,7 +52,11 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
||||
<dialog
|
||||
tabindex="0"
|
||||
onkeydown={onKeyDown}
|
||||
bind:this={dialogElement}
|
||||
class:default={width === 'default'}
|
||||
class:large={width === 'large'}
|
||||
|
Loading…
Reference in New Issue
Block a user