nextcloud-libraries / nextcloud-libraries/nextcloud-vue

Outline from `:focus-visible` on NcAction* items shows when it is not supposed to in Safari 🍏

Open
#4,874 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

browser: Safari bug feature: actions regression
Dominant language
Vue
Stars
246
Forks
99
Avg merge
1d 20h
Merged PRs (30d)
103

Description

Originally posted in https://github.com/nextcloud/server/issues/41450

Black border in "New" menu in Safari: There is a black border on the first entry of the "New" menu. It should only appear on tab navigation, not on initial opening or interacting with the mouse. → Bug with Safari, does not appear with Chrome.

Kind of regression https://github.com/nextcloud/server/pull/39943


When NcActions is open and on mouse move, an item is focused by .focus() method.

How it supposed to work in Web-Browser:

  1. If a user clicks on a focusable element and the focus is moved via .focus(), the focused element should not be :focus-visible.
  2. If a user clicks on a not focusable element and the focus is moved via .focus(), the focused element should be :focus-visible.

So in NcActions on open and mouse move, the items ARE NOT SUPPOSED to be :focus-visible.

However, it doesn't work in Safari. Although this bug is fixed (https://bugs.webkit.org/show_bug.cgi?id=236782), it still appears in NcActions. Moving focus on Safari sometimes marks an element with :focus-visible. Moreover, sometimes a random action on the page changes this behavior and it works fine.

Somehow Safari doesn't understand, that the focus is moved after click on the button.

https://github.com/nextcloud-libraries/nextcloud-vue/assets/25978914/ec098e43-360c-4112-89d0-468c59e9ce91

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 Safari behavior when NcActions opens and focus moves on mouse movement, comparing it with Chrome. Trace the focus handling in the NcActions component and verify that opening or mouse interaction does not show a :focus-visible outline, while keyboard navigation still does.

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.