Closed KagamiChan closed 1 year ago
Also note that if you leave "open={true}" the behavior persists. I thought maybe it was a race condition.
One question is, why do you need to conditionally render the Dialog? The DOM is not injected until open is set to true. It's possible that this behavior is by design, but I will check.
Thanks for helping,
In our project we use redux to store the Dialog instance and mount this instance in a same place. So we always set open=true for these <Dialog />
s. And we see the same issue when the first <Dialog />
is saved to the store
Another use case I can think of could be immediately opening up a dialog when user navigates to a specific path with browser router or server side
The code worked for version 9.8.0
but we discovered this issue when I tried to upgrade to 9.14.0
/19.15.0
Seems like our a11y mechanism from tabster is locking you out of the dialog. Wrap the Button
that is opening the Dialog
component with DialogTrigger
to ensure proper attributes to the Button
, otherwise there's not way to know that the navigation you've made is a proper one.
https://codesandbox.io/s/agitated-fog-muketx?file=/example.tsx
There's a session on Dialog
's documentation dedicated to show what should you do if you have a trigger outside of a dialog. https://react.fluentui.dev/?path=/docs/components-dialog--default#trigger-outside-dialog
Thanks @bsunderhus you're correct, the button should be wrapped. However I think the button itself is irrelevant to the issue described here.
I'm able to construct a modified example without the button, please check https://codesandbox.io/s/focused-sid-ml3ty9?file=/example.tsx, here I use setTimeout
to mount the Dialog which does not require any user interaction
updated the example link in the issue to the new one too
The problem is basically the same @KagamiChan, our a11y mechanism expects the dialog to be opened by a click on an element with the proper attributes, and since you're not doing that you're getting locked out of the dialog.
Definitely there should be a proper alternative here that allow you to use the Dialog
component without getting yourself locked out of it by tabster. I'll investigate that! Thanks for opening the issue.
After a deep dive into this, seems like tabster is not being properly initialised. This has been cause on the last update of tabster version 4.
A quick fix for this problem is to manually initialise tabster by ivoking some of the tabster hooks, like this: https://codesandbox.io/s/quizzical-danilo-r7f55e
Another quick solution would be to manually focus on the first element: https://codesandbox.io/s/xenodochial-taussig-x8wzbx?file=/example.tsx
+1 Upgraded project to fluentui9, using dialog for data entry with open attribute (was using Panel in v8), and immediatly hit this issue.
This is under investigation by tabster experts https://github.com/microsoft/tabster/issues/250! I'll keep this updated if anything changes
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-slider@v9.1.14
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-avatar@v9.5.2
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-switch@v9.1.14
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-card@v9.0.11
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-components@v9.20.2
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-data-grid-react-window@v9.0.0-beta.26
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-persona@v9.2.12
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-alert@v9.0.0-beta.48
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-datepicker-compat@v0.1.2
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-popover@v9.5.13
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-menu@v9.7.13
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-infobutton@v9.0.0-beta.31
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-accordion@v9.1.13
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-link@v9.0.39
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-tree@v9.0.0-beta.15
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-tabster@v9.7.2
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-migration-v8-v9@v9.2.13
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-table@v9.2.10
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-button@v9.3.13
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-checkbox@v9.1.14
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-combobox@v9.3.2
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-dialog@v9.5.6
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-portal-compat@v9.0.57
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-portal@v9.2.9
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-provider@v9.6.2
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-radio@v9.1.14
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-tabs@v9.3.14
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-toolbar@v9.1.14
.:tada:
Handy links:
:tada:This issue was addressed in #27540, which has now been successfully released as @fluentui/react-tooltip@v9.2.13
.:tada:
Handy links:
It seems the bug still exist even after upgrading to react-components version 9.20.2 with tabster 4.4.2. Can anyone confirm?
I'm having the same issue as @nograx posted 2 weeks ago. I've upgraded to 9.5.9
of @fluentui/react-dialog
but am still getting the same error. I don't get the error in the browser but when running tests, using both jsdom
and happy-dom
.
Library
React Components / v9 (@fluentui/react-components)
System Info
Are you reporting Accessibility issue?
no
Reproduction
https://codesandbox.io/s/focused-sid-ml3ty9
Bug Description
Actual Behavior
the dialog with open=true is mounted and open, but none of the inputs could be focused
Expected Behavior
When the dialog is mounted, elements in the dialog could be focused
Logs
Requested priority
Normal
Products/sites affected
No response
Are you willing to submit a PR to fix?
no
Validations