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

Tabster async autoroot initialization breaks certain Fluent scenarios #250

Closed
bsunderhus opened this issue Mar 8, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@bsunderhus
Copy link
Collaborator

This happened during the Modalizer revamp: Modalizer revamp by mshoho · Pull Request #218 · microsoft/tabster (github.com)

 

Reported issue: [Bug]: dialog directly mounted with open=true could not get focus · Issue #26824 · microsoft/fluentui (github.com)

Repro (also in the bug): Sandbox - CodeSandbox (csb.app)

 

What seems to be happening is that since tabster@4.1.1 is that the autoroot creation is now async. This means that when a Fluent component that uses tabster is mounted, it generates errors because only the first usage of tabster initialized the autoroot. Since this is async, the React component can't actually use tabster on first render.

 

In the repro:

  • The dialog is mounted
  • tabster does not exist
  • dialog initializes tabster
  • dialog uses modalizer
  • tabster error -> no autoroot created
  • tabster creates autoroot
  • modalizer is inactive because there was not root
  • can't tab any element in the dialog
  • use the console to call .focus() on an element
  • now the modalizer is active
@angelo-mollame
Copy link

@bsunderhus can you please share where/how this issue was fixed? I can still repro the issue with "@fluentui/react-components": "9.49.1".

@bsunderhus
Copy link
Collaborator Author

bsunderhus commented May 6, 2024

We've updated latest tabster versions in Fluent v9 and the newest version should have this problem solved. Can you share a reproduction of the problem with "@fluentui/react-components": "9.49.1". @angelo-mollame ?

Here's a working example: https://stackblitz.com/edit/hirhwd?file=src%2Fexample.tsx

@angelo-mollame
Copy link

I created an issue and added repro steps here: microsoft/fluentui#31421

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

No branches or pull requests

2 participants