sindresorhus/refined-github

Do you want to work on this issue?

You can request for a bounty in order to promote it!

`bugs-tab` removes highlight from "Issues" tab after ajax navigation #4782

fregante posted onGitHub

Please ensure:

  • The bug is caused by Refined GitHub. It doesn't happen if I disable the extension.

Description

  1. Click Issues tab
  2. Click Issues tab

One click may be enough.

This doesn't happen if bugs-tab is disabled

Screenshot

https://user-images.githubusercontent.com/1402241/133208841-a2c0bbc3-8fa3-4da4-9c76-a94647d00450.mov

Console errors

No response

Example URL

https://github.com/sindresorhus/refined-github/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc

Browser(s) used

Safari 14


Duplicate of #4579 ?

posted by cheap-glitch over 3 years ago

We've got so many bugs that even @fregante is starting to forget them 😂

Jokes aside, I investigated this a little bit since I reported a similar bug in EnixCoda/Gitako#173.

GitHub code for highlighting is at https://github.githubassets.com/assets/app/assets/modules/github/behaviors/side-navigation.ts:

// Deal with selected_link_to on repository and gist pages
document.addEventListener('pjax:end', function () {
  const meta = document.querySelector('meta[name="selected-link"]')
  const selection = meta && meta.getAttribute('value')
  if (!selection) {
    return
  }
  for (const item of document.querySelectorAll('.js-sidenav-container-pjax .js-selected-navigation-item')) {
    const isSelected = (item.getAttribute('data-selected-links') || '').split(' ').indexOf(selection) >= 0
    isSelected ? item.setAttribute('aria-current', 'page') : item.removeAttribute('aria-current')
    item.classList.toggle('selected', isSelected)
  }
})

It is looking for the data-selected-links attribute:

image

However this is missing when bugs-tab enabled:

image

posted by kidonng over 3 years ago

So is it GitHub's code that's removing it? What value should the attribute have?

posted by fregante over 3 years ago
posted by kidonng over 3 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests