Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: sp-button receives focus indicator again in Safari iOS after overlay closes #4813

Open
1 task done
lehelen19 opened this issue Oct 11, 2024 · 2 comments
Open
1 task done
Labels
Browser: Safari bug Something isn't working Component: Button iOS bug reported in iOS devices jira ticket created

Comments

@lehelen19
Copy link
Contributor

lehelen19 commented Oct 11, 2024

Code of conduct

  • I agree to follow this project's code of conduct.

Impacted component(s)

sp-button

Expected behavior

The button should not have the focus indicator or trigger a hover overlay after a click overlay has been closed.
Context: https://cclight.slack.com/archives/CESK60MQD/p1728667671120189?thread_ts=1728586798.425799&cid=CESK60MQD

Actual behavior

The button gets refocused with a visible blue focus indicator, and a hover overlay gets triggered if the button also has one.

Screenshots

image

What browsers are you seeing the problem in?

No response

How can we reproduce this issue?

  1. Go to https://studio.webcomponents.dev/edit/bu0sOBIfyW7wnHkXtGzL/src/index.ts?p=stories on an iOS device
  2. Click on the Button popover button
  3. Click out to close the overlay
  4. Observe the button getting refocused (and the tooltip appearing)

Sample code or abstract reproduction which illustrates the problem

No response

Severity

None

Logs taken while reproducing problem

No response

@lehelen19 lehelen19 added bug Something isn't working needs jira ticket triage An issue needing triage labels Oct 11, 2024
@najikahalsema
Copy link
Collaborator

This behaviour of returning focus to the overlay trigger upon closing the overlay is expected, but the issue is that :focus-visible class shows up only in Safari, which shows the focus ring when it doesn't in other browsers.

We fixed this issue for picker via #4724 and we'll look into whether we can fix this issue in this context, as well.

@mizgaionutalexandru
Copy link
Contributor

mizgaionutalexandru commented Nov 4, 2024

Hi, @lehelen19 ,
It looks like the issue is not reproducible using the trigger directive or the overlay itself, only with the overlay-trigger (that's also reproducible on MacOS Safari).

While AFAIK SWC is slowly moving away from the overlay-trigger, it seems like the problem resides in the fact that the HoverController relies on the :focus-visible that has some different heuristics in Webkit vs other engines, therefore a PR with a fix will open soon. In the meantime feel free to use the other options I've mentioned if they fit your needs.

PS: It looks like all of the versions that I've mentioned reproduce the issue if the type="modal" is added. Might not be that helpful afterall 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser: Safari bug Something isn't working Component: Button iOS bug reported in iOS devices jira ticket created
Projects
None yet
Development

No branches or pull requests

3 participants