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

Upstream fix: Can't focus component that was just mounted #1412

Closed
nakambo opened this issue Sep 1, 2022 · 3 comments · Fixed by #1398
Closed

Upstream fix: Can't focus component that was just mounted #1412

nakambo opened this issue Sep 1, 2022 · 3 comments · Fixed by #1398
Labels
bug Something isn't working Needs: Triage 🔍 Stale

Comments

@nakambo
Copy link
Collaborator

nakambo commented Sep 1, 2022

Environment

RNTester app. I am adding a test page to demonstrate the issue.

I have repro on 0.66 in my environment -- but I also repro on against main in the tester app.

Steps to reproduce the bug

  1. Open RNTester app (macOS)
  2. Click on "Focus on Mount"
  3. Observe

Expected Behavior

Based on how the test page is written, the component should be focused.

Actual Behavior

It isn't focused.

Reproducible Demo

See repro instructions for demo in tester app. I will be adding a page to the tester app after creating this issue.

Additional context

  • reactFocusIsNeeded is never called for a plain RCTView
  • focus state is tracked on a per-view basis; should ideally be per-window, perhaps simply tracking it globally is sufficient as well. It should not be tracked per-view, because only one can ultimately win (the last one -- assuming it also didn't give up on focus while it was "winning").
@nakambo nakambo added the bug Something isn't working label Sep 1, 2022
@ghost ghost added the Needs: Triage 🔍 label Sep 1, 2022
@nakambo nakambo linked a pull request Sep 1, 2022 that will close this issue
4 tasks
@Saadnajmi Saadnajmi changed the title Can't focus component that was just mounted Upstream fix: Can't focus component that was just mounted Sep 7, 2022
@Saadnajmi Saadnajmi reopened this Sep 7, 2022
@Saadnajmi
Copy link
Collaborator

Going to re-open this issue as a "potentially upstream able fix" kinda issue. Will revisit once we've let our fix make it's way downstream and has had time to be tested/verified more

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Mar 22, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: Triage 🔍 Stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants