The element in dialog lost focus state. #2436
Labels
Package: react/dialog
Package: react/focus-scope
Resolution: Needs More Information
More information is needed on this issue
Bug report
Current Behavior
There is an input element A comes with a custom clear icon in a dialog component, and in its focusout event, the focus behavior of another input element B in the dialog component is triggered. It is found that the trigger failed and the cursor does not enter the B element.
Expected behavior
The cursor enters the B element.
Reproducible example
Suggested solution
I looked at the context source code of the dialog component and read the following in the focus-scope file:
With the MutationObserver feature, if an element is removed (the input A lost focus, the clear icon is removed), then the focus will be placed on the container (react-dialog root) node, cause the focus of the element B to be lost immediately.
Additional context
Your environment
The text was updated successfully, but these errors were encountered: