nextcloud / nextcloud/viewer

Navigating via keyboard and opening photos, Viewer does not take focus, and resets focus to beginning of Files list after closing

Open
#860 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
119
Forks
72
Avg merge
18h 42m
Merged PRs (30d)
24

Description

Describe the bug
When navigating via keyboard and opening a photo with the viewer, the tab focus is not taken correctly. That is, it still remains in the same spot as before in the file list or photo list even though the viewer is open. That leads to being able to navigate through photos with left/right arrow keys and being able to exit using esc, but you can not activate the slideshow or open the sidebar from this view.

Then when you exit the Viewer using Esc, the Tab position is reset to the top of the Files list which is also not expected.

@skjnldsv noted in addition:

We would need to restore the focus on the initial element that had it before, might be tricky, we never did that! :)

To Reproduce
Steps to reproduce the behavior:

  1. Go to Files
  2. Start using Tab on your keyboard to go through entries (you can use the "Skip to content" link)
  3. Open a photo via Enter
  4. Exit the Viewer via Esc
  5. Be reset to the top of the Files list

Expected behavior
When you open the Viewer, the first focusable element of the viewer is focused, and when you exit it, the last focused element is remembered so you can easily continue.

(Question would be if it remembers the last focused element before the Viewer was opened, or if focuses the file which was last open in the Viewer – just in case images were navigated using the Viewer.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the keyboard flow in Files: open a photo with Enter, inspect focus while the Viewer is open, then close it with Esc. Trace the Viewer and Files focus handling to determine how the initial element is retained; done means the first Viewer control receives focus and closing restores the appropriate prior or opened-file element.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.