fluentui
fluentui copied to clipboard
[Bug]: ignoreExternalFocusing prop on Dialog is not being honored and focusing of the previously element is still in effect
Library
React / v8 (@fluentui/react)
System Info
System:
OS: Windows 10 10.0.19044
CPU: (16) x64 Intel(R) Xeon(R) W-11955M CPU @ 2.60GHz
Memory: 32.06 GB / 63.67 GB
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.42)
Internet Explorer: 11.0.19041.1566
Are you reporting Accessibility issue?
No response
Reproduction
https://codepen.io/zeddox/pen/dyeRayZ
Bug Description
Actual Behavior
With the ignoreExternalFocusing
set to true, the previously focused element is refocused when the Dialog
is dismissed
Expected Behavior
With the ignoreExternalFocusing
set to true, the previously focused element is not refocused when the Dialog
is dismissed and the modalProps.onDismissed
can be used to focus elsewhere.
Logs
No response
Requested priority
Blocking
Products/sites affected
Internal Microsoft application
Are you willing to submit a PR to fix?
yes
Validations
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] The provided reproduction is a minimal reproducible example of the bug.
This functionality was previously working, but with the update to a functional component version of Popup
, the useRestoreFocus
hook does not check the ignoreExternalFocusing
prop (looks like it was previously a shouldRestoreFocus
prop).
Previous issue for reference: 18564
@gouttierre @ling1726 @ecraig12345 for visibility
Issue still persists in latest version of v8. Seems to stem from Popup
not accounting for the shouldRestoreFocus
prop. Adding a condition to only restore focus if shouldRestoreFocus
is true will probably fix this.
https://github.com/microsoft/fluentui/blob/3916d4647dcc180d4ea4c30b296b0866e6315d69/packages/react/src/components/Popup/Popup.tsx#L81-L90
Because this issue has not had activity for over 180 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.