You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scrolling in sidebar, selected item loses focus if out of view #2957
bugConfirmed bugs or reports that are very likely to be bugshelp wantedIssues marked as ideal for external contributorspriority-3Bugs that affect small number of users and/or relatively cosmetic in nature
When you have one item selected in the item/source list for changed files and scroll the item out of view it will lose focus and not regain its focus once returned into view. See attached screen recording below.
Version
GitHub Desktop version: 1.0.3
OS version: macOS 10.12.6 (16G29)
Steps to Reproduce
Have enough changes so that Desktop will allow you to scroll.
Select one item.
Scroll so that the item is no longer visible.
Scroll back so that the item becomes visible again.
Expected behavior: The item should always keep its focus.
It's not just the colour. When the item has focus, the focus can be moved up and down to the previous/next items. But when losing the focus (and it it using the secondary grey colour) focus can no longer be moved up or down using the arrow keys.
This is an unfortunate side-effect of using virtualized lists in many places. @niik talked a bit more about this limitation in #1669 (comment). I'll let him follow up with anything else, but maybe we do need to track this as a separate task.
Thanks for opening this @NiklasBr and nice find @shiftkey. I was scouring through issues because I knew I'd written something about this before but I couldn't find it. I definitely think this is worth tracking but as I said in that comment the fix is non-trivial.
bugConfirmed bugs or reports that are very likely to be bugshelp wantedIssues marked as ideal for external contributorspriority-3Bugs that affect small number of users and/or relatively cosmetic in nature
Activity
tierninho commentedon Oct 4, 2017
Looks like we have a main and secondary color. @desktop/design can shed some light on this.
Can reproduce with clone repo list as well.
NiklasBr commentedon Oct 4, 2017
It's not just the colour. When the item has focus, the focus can be moved up and down to the previous/next items. But when losing the focus (and it it using the secondary grey colour) focus can no longer be moved up or down using the arrow keys.
shiftkey commentedon Oct 4, 2017
This is an unfortunate side-effect of using virtualized lists in many places. @niik talked a bit more about this limitation in #1669 (comment). I'll let him follow up with anything else, but maybe we do need to track this as a separate task.
niik commentedon Oct 4, 2017
Thanks for opening this @NiklasBr and nice find @shiftkey. I was scouring through issues because I knew I'd written something about this before but I couldn't find it. I definitely think this is worth tracking but as I said in that comment the fix is non-trivial.
danny007in commentedon May 3, 2021
NiklasBr commentedon May 3, 2021
@danny007in video is available in the first comment in this issue as well as in #1669
markhicken commentedon Nov 11, 2022
According to https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement#value document.activeElement is
document.bodyornullby default or when nothing is focused. I tested this and found that Chromium does set the default value todocument.body. I thought maybe when the selected element(s) come back into existence, we could check theactiveElementand refocus the selected item(s) if it is still set to the body. I have submitted the following PR for review...#15604