mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-28 17:50:28 +08:00
Fix keyboard submit
This commit is contained in:
+4
-2
@@ -14,9 +14,11 @@
|
||||
import Modal from '@app/Modal.svelte';
|
||||
|
||||
function handleKeydown(event: KeyboardEvent) {
|
||||
// TODO: Fix this when there's a modal.
|
||||
if (event.key === 'Enter') {
|
||||
(document.querySelector('button.primary') as HTMLElement).click();
|
||||
let elems = document.querySelectorAll('button.primary') as NodeListOf<HTMLElement>;
|
||||
if (elems.length == 1) { // We only allow this when there's one primary button.
|
||||
elems[0].click();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
</div>
|
||||
<div>
|
||||
{#if isOwner(org)}
|
||||
<button class="tiny primary" on:click={setName}>
|
||||
<button class="tiny secondary" on:click={setName}>
|
||||
Set
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user