Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix keyboard submit
Alexis Sellier committed 4 years ago
commit 09c4db8cdd6c48458e6486b141e0f97025faf5c0
parent 19a85b795403d56c14793a24aa05ddd4e3524a1f
2 files changed +5 -3
modified src/App.svelte
@@ -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>
modified src/base/orgs/View.svelte
@@ -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}