Skip to content

github.com - quote reply shortcut doesn't work when theres a checkbox #30041

Closed

Description

@miketaylr

URL: mozilla/webcompat-team-okrs#76

Browser / Version: Firefox 67.0
Operating System: Mac OS X 10.14
Tested Another Browser: Unknown

Problem type: Something else
Description: Pressing r to create a quoted reply doesn't work when selection includes checkbox
Steps to Reproduce:
Go to the URL, select one of the TODOs (the items with checkboxes), and press r

Expected: You get a comment like so (which is what happens in Chrome):

> * [ ]  Come up with a convention to include bugs older than 1 year in the Fresh bugs list
> *

Actual: You just get a single >
Screenshot Description

Browser Configuration
  • None

From webcompat.com with ❤️

Activity

  1. added this to the needstriage milestone on Apr 26, 2019
  2. changed the title [-]github.com - see bug description[/-] [+]github.com - quote reply shortcut doesn't work when theres a checkbox[/+] on Apr 26, 2019
  3. added
    severity-important
    engine-gecko
    on Apr 26, 2019
  4. karlcow commented on May 20, 2019

    @karlcow
    Member

    The content has changed there.

    So first a test without selection.

    Screenshot Description

    Then let's try with selection.

    Screenshot Description

    it misses the end of the selection.

    <details-menu class="dropdown-menu dropdown-menu-sw show-more-popover text-gray-dark anim-scale-in" style="width:185px" role="menu">
      <clipboard-copy class="dropdown-item btn-link" for="gistcomment-2921490-permalink" role="menuitem" tabindex="0">Copy link</clipboard-copy>
      <button type="button" class="dropdown-item btn-link js-comment-quote-reply" role="menuitem">Quote reply</button>
      <div role="none" class="dropdown-divider"></div>
      <button type="button" class="dropdown-item btn-link js-comment-edit-button" role="menuitem" aria-label="Edit comment">Edit</button>
      <!-- '"` -->
      <!-- </textarea></xmp> -->
      <form class="width-full inline-form js-comment-delete" action="/karlcow/24db5d1c03aec08c3d0ea999184c95ca/comments/2921490" accept-charset="UTF-8" method="post">
        <input name="utf8" type="hidden" value="✓">
        <input type="hidden" name="_method" value="delete">
        <input type="hidden" name="authenticity_token" value="KvtQNvB3zYsLLfF0FkEzgwtqPrgUMq/sbdMGgOtnUeRA5pJwi9wKN6PVenfmrWCZ/+m/bOv2U9/WHIPh90hNLQ==">
        <input type="hidden" name="input[id]" value="MDExOkdpc3RDb21tZW50MjRkYjVkMWMwM2FlYzA4YzNkMGVhOTk5MTg0Yzk1Y2E6MjkyMTQ5MA==">
        <button type="submit" class="dropdown-item menu-item-danger btn-link" aria-label="Delete comment" role="menuitem" data-confirm="Are you sure you want to delete this?">Delete</button>
      </form>
    </details-menu>

    The specific line is

    <button type="button" class="dropdown-item btn-link js-comment-quote-reply" role="menuitem">Quote reply</button>

    This is probably related to this section of the code.

      x("click", ".js-comment-quote-reply", function(e) {
        const t = N(O(e.currentTarget, ".js-comment"), ".js-comment-body");
        if (ol && "Range" === ol.type && t.contains(ol.anchorNode))
          tt(ol.text, ol.range);
        else {
          const e = window.getSelection();
          e.removeAllRanges(),
            e.selectAllChildren(t),
            tt(e.toString(), e.getRangeAt(0));
        }
      }),
        document.addEventListener(
          "selectionchange",
          (function(e, t) {
            let n;
            return function() {
              for (var o = arguments.length, r = new Array(o), i = 0; i < o; i++)
                r[i] = arguments[i];
              clearTimeout(n),
                (n = setTimeout(() => {
                  clearTimeout(n), e(...r);
                }, t));
            };
          })(function() {
            const e = window.getSelection();
            let t;
            try {
              t = e.getRangeAt(0);
            } catch (au) {
              return void (nl = null);
            }
            nl = {
              type: e.type,
              anchorNode: e.anchorNode,
              text: e.toString(),
              range: t
            };
          }, 100)
        ),

    This is a bit hard to debug. The source map is not working properly.

    but I have the feeling this is related to #28521 if not even the same issue.
    And also related to https://bugzilla.mozilla.org/show_bug.cgi?id=1360238

  5. lock commented on May 27, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue at https://webcompat.com/issues/new if you are experiencing a similar problem.

  6. locked as resolved and limited conversation to collaborators on May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    browser-firefoxengine-geckopriority-criticalseverity-important

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions