Make sure help panel is focused when open, and focus is restored when closed #5361
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR leverages the new
Dialog
component capabilities to be focused when opened, and restore focus when closed, to enhance the help panel.There's one limitation though. The help panel is currently wrapped in a
Slider
, which adds a nice slide-down/slide-up animation when opened/closed.This makes the
initialFocus="auto"
in theDialog
to not work as expected.As a POC I have removed the slider, just to verify that we can fix the accessibility issue with the new
Dialog
. However, if we want to keep the animation, theDialog
needs to be evolved.You can see the new behavior here.
dialog-help-panel.mp4