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

[RAC] <Link> gets focus-outline attributes on window blur. #7468

Open
endreujhelyi opened this issue Dec 4, 2024 · 6 comments
Open

[RAC] <Link> gets focus-outline attributes on window blur. #7468

endreujhelyi opened this issue Dec 4, 2024 · 6 comments

Comments

@endreujhelyi
Copy link

endreujhelyi commented Dec 4, 2024

Provide a general summary of the issue here

On mobile, when a Link is touched, it gets focus-outline attributes and styles on window blur. For client-side routing, if I switch apps to trigger the window blur and then return to the application, the last triggered link retains the focus-outline style.

🤔 Expected Behavior?

The <Link> should not receive the focus-outline style under any circumstances on mobile.

Based on the documentation:

isFocusVisible [data-focus-visible] Whether the link is keyboard focused.

😯 Current Behavior

The <Link> gets focus-outline style and attributes on the window blur event. This issue can be easily reproduced on both the website examples and the official public Storybook.

💁 Possible Solution

No response

🔦 Context

We are using the <Link> component in the Tab Bar of our mobile navigation, which has a focus-outline style defined. When switching applications back and forth, our Tab Bar links receive the focus-outline style. This is not the expected behavior.

🖥️ Steps to Reproduce

Screen recordings:

Version

1.5.0

What browsers are you seeing the problem on?

Chrome, Safari

If other, please specify.

No response

What operating system are you using?

iOS 18

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@endreujhelyi endreujhelyi changed the title <Link> gets focus-outline attributes on touch. <Link> gets focus-outline attributes on window blur. Dec 4, 2024
@endreujhelyi endreujhelyi changed the title <Link> gets focus-outline attributes on window blur. [RAC] <Link> gets focus-outline attributes on window blur. Dec 5, 2024
@yihuiliao
Copy link
Member

yihuiliao commented Dec 5, 2024

What device and iOS version are you using? I can't seem to reproduce on my iPhone 13 + iOS 18. Here's a
of what I'm seeing:

ScreenRecording_12-05-2024.11-33-45_1.MP4

@lukeapage
Copy link

I work with endre - I just tried and I can reproduce.
iPhone 15, iOS 18.

it happened 3 times in a row but only the first time. After clicking away from the link it’s no longer reproducible.

@lukeapage
Copy link

Ok fourth time it didn’t happen, fifth it did

@lukeapage
Copy link

https://youtube.com/shorts/m9faC2vUc6Q?si=9PEOnlEygxf3FGqx

@yihuiliao
Copy link
Member

Ah, okay I can reproduce it now. Thanks for the additional information. At least for me, I have to touch it in a certain way for it to render with the focus ring but I haven't been able to get it consistently.

@yihuiliao
Copy link
Member

Seems like previously in other components, focus visible was triggered on window blur and we prevented that by keeping the previous modality so it would probably make sense to do the same here.

Related issues: #1912, #1813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants