Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix autofocus issues on comment components
Sebastian Martinez committed 2 years ago
commit adb6e06f9e332ad8bb8797ad2adee9875b1091d6
parent 30691986540228424d76db4ab6c8e3f9e721fb1c
4 files changed +4 -1
modified src/components/Textarea.svelte
@@ -41,7 +41,7 @@
  });

  afterUpdate(() => {
-
    if (textareaElement) {
+
    if (textareaElement && focus) {
      textareaElement.setSelectionRange(selectionStart, selectionEnd);
      textareaElement.focus();
    }
modified src/components/Thread.svelte
@@ -114,6 +114,7 @@
    <div id={`reply-${root.id}`} class="reply">
      <CommentToggleInput
        {rawPath}
+
        focus
        inline
        placeholder="Reply to comment"
        on:click={toggleReply}
modified src/views/projects/Issue.svelte
@@ -631,6 +631,7 @@
          {#if threads.length === 0}
            <div class="connector" />{/if}
          <CommentToggleInput
+
            focus
            rawPath={rawPath(project.head)}
            placeholder="Leave your comment"
            enableAttachments
modified src/views/projects/Patch.svelte
@@ -977,6 +977,7 @@
                  <div class="connector" />
                  <CommentToggleInput
                    rawPath={rawPath(patch.revisions[0].id)}
+
                    focus
                    enableAttachments
                    placeholder="Leave your comment"
                    submit={partial(