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

Fix FocusScope missing parent element #3908

Merged
merged 6 commits into from
Jan 17, 2023
Merged

Conversation

snowystinger
Copy link
Member

@snowystinger snowystinger commented Jan 12, 2023

Closes #3877

We're still trying to figure out what circumstances can lead to this, discussion in the issue. However, it's a safe enough guard. The first thing that focusFirstInScope will call is getScopeRoot, which may return null/undefined. Rather than blow up the application, we can just do nothing.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Unit tests pass, focus is normally contained in all existing stories

🧢 Your Project:

@snowystinger snowystinger added the small review Easy to review PR label Jan 14, 2023
Copy link
Contributor

@filipw01 filipw01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really happy we found the root cause

@rspbot
Copy link

rspbot commented Jan 17, 2023

@rspbot
Copy link

rspbot commented Jan 17, 2023

@rspbot
Copy link

rspbot commented Jan 17, 2023

## API Changes

unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }

@snowystinger snowystinger merged commit b6786da into main Jan 17, 2023
@snowystinger snowystinger deleted the fix-focusscope-missing-parent branch January 17, 2023 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small review Easy to review PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@react-aria/focus - Failed to execute 'createTreeWalker' on 'Document'
5 participants