-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(dialog): restore focus with the proper focus origin #9257
fix(dialog): restore focus with the proper focus origin #9257
Conversation
aaef71b
to
48df402
Compare
Addressed the feedback and also added the check for the |
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.
LGTM
259cad2
to
3327650
Compare
@devversion please rebase |
3327650
to
dabfa26
Compare
@mmalerba Done. |
Hi @devversion! This PR has merge conflicts due to recent upstream merges. |
1 similar comment
Hi @devversion! This PR has merge conflicts due to recent upstream merges. |
dabfa26
to
67edd91
Compare
@josephperrott Rebased that one. Can we retry a presubmit in the future? |
c8f02e9
to
67541e2
Compare
@jelbourn @josephperrott I rebased this one again. should we proceed with that one or don't you think it's worth moving forward with that? It definitely seems like a reasonable a11y feature for the dialog to me. |
Just a quick bump that it would be awesome to get this in. |
67541e2
to
b34c034
Compare
Rebased again. If we decide to move forward with this, then the changes should most likely also be ported over to the |
@devversion Want to move forward with this PR? If so, this is our next oldest P2 and I'm going to make it my side project to get a green presubmit with it. |
b34c034
to
60c6895
Compare
@andrewseguin That would be awesome. I've rebased the PR. Let me know if I can help somehow! |
60c6895
to
82523fc
Compare
We're at a fork in the roads on this PR. This breaks a lot of internal tests. Many tests provide a fake dialog ref using jasmine, e.g.
Then in their test, they check that close was called:
This change breaks that because now The "right thing to do" is to provide a fake for users so they don't need to make their own. Then they can just verify through the fake that An alternative path forward is to change this code a bit so that
Then during This is obviously not ideal or best practice to be setting some state before calling a function, but a comment could be provided to explain why this is the case, as well as an additional test that makes sure we don't regress. I still think it would be valuable to provide a fake to our users, but at least this won't be blocked on that migration occurring, which could possibly never get prioritized. |
82523fc
to
682b751
Compare
@andrewseguin Thanks for looking into this. I've made the changes as discussed. Instead of manually assigning |
Restores the trigger focus upon dialog close with the proper focus origin that caused the dialog closing. For example, a backdrop click leads to a focus restore via `mouse`. Pressing `escape` leads to a focus restore via `keyboard`. Clicking the `matDialogClose` button will depend on the type of interaction (e.g. `click` or `keyboard`) References angular#8420.
682b751
to
b795853
Compare
Restores the trigger focus upon dialog close with the proper focus origin that caused the dialog closing. For example, a backdrop click leads to a focus restore via `mouse`. Pressing `escape` leads to a focus restore via `keyboard`. Clicking the `matDialogClose` button will depend on the type of interaction (e.g. `click` or `keyboard`) References #8420.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
For example, a backdrop click leads to a focus restore via
mouse
. Pressingescape
leads to a focus restore viakeyboard
.References #8420