sindresorhus/refined-github

Incorrect tab gets highlighted when opening an issue in the bugs section #4164

yashshah1 posted onGitHub

STR:

  1. Goto https://github.com/sindresorhus/refined-github/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug.
  2. Notice that the tab highlighted on the top is Bugs
  3. Open any active issue, the tab highlighted switches to Issues.

Shouldn't the tab highlighted be the bugs tab?

Video:

https://user-images.githubusercontent.com/31387795/112757564-e371f800-9007-11eb-98a9-ed645fd6b30b.mov


Not a bad idea

posted by fregante about 4 years ago

Something like this should work

goes at the end of the init not to delay anywhere else

    if (pageDetect.isIssue()) {
        const sideBarLables = await elementReady('#partial-discussion-sidebar .sidebar-labels');
        const hasBugLabel = select.exists('.IssueLabel[href$="bug" i]', sideBarLables);
        bugsTab.classList.toggle('selected', hasBugLabel);
        issuesTab.classList.remove('selected');
        issuesTab.removeAttribute('aria-current');
    }

however this does not work on history.back()

posted by yakov116 about 4 years ago

however this does not work on history.back()

Separate init

posted by fregante about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests