-
Notifications
You must be signed in to change notification settings - Fork 3
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
UIQM-728 Keep focus on last focused element when user cancels on confirmation modals. #767
Conversation
setTimeout(() => { | ||
focusLastFocusedInput(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It looks like there is a need to close a modal first and then invoke the
focusLastFocusedInput
. Is it possible? - Where should the focus be after a field is linked/unlinked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess remove linking is not applicable for current story if it only happens instantly when a record has been opened for deriving. I'll remove this code because it's not needed.
But generally a modal will close first, and a last focused element will be re-focused second:
chrome_88Sf3gA0LK.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But generally a modal will close first, and a last focused element will be re-focused second:
I meant setTimeout
is used to trigger the focus after modal is closed (state is false
) and whether it is possible to do it without setTimeout
, just wait until modal state changes to false
, but I think it will require a lot more changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dmytro-Melnyshyn oh I see. it's not because we're waiting for the modal to close, but we need the form to finish all updates. If we set focus right away it'll be gone when the form updates. And there's no way to know when it does so we have to use setTimeout
here
Quality Gate passedIssues Measures |
Description
When a user chooses "Cancel" option on any of the confirmation modals they should have focus on the last focused element before the modal opened.
Screenshots
chrome_KFrvuuzME3.mp4
Issues
UIQM-728