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
feat(modal): add a11y module and apply focus trap to modal dialog #1464
Conversation
@changLiuUNSW excellent timing as we are on the accessibility topic right now. I will schedule review of this one for the next release. Thnx for taking a stab at it! |
6cd0a62
to
8dc996a
Compare
Question about focus trapping - is there no better way to trap the focus with modals? I know we do this in UI Bootstrap, but it was a major pain and error prone. |
Cannot find any better solution. |
To fully implement the accessibility for modal, we should add |
@changLiuUNSW @wesleycho so I went through the code in this PR and effectively, it is not simple... I'm particularly concerned with the amount of browser sniffing and low-level DOM manipulation involved... Then again, I'm not saying I've got a simpler solution. I think I was a bit too optimistic about reviewing / landing it as part of this release - I want to take some time to review it better and compare other implementations. In any case accessibility is our top focus for the next days / weeks (as you can see from all the commits that go into this repo) so even if I'm not merging this one today, it remains on top of my priority list. Once again, thnx for the PR, please bear with us for few more days... |
Material Design Components use the following for focus trap that may offer some inspiration: https://github.com/davidtheclark/focus-trap |
@RobJacobs The focus trap of this PR is already from material 2 |
@pkozlowski-opensource Thanks, I totally understand your concerns and hope you would find any better solutions. |
@pkozlowski-opensource Just update the PR with latest changes from material 2 |
Hi guys. Do you have any updates regarding this fix? |
So sad this update was not included in the milestone alpha.27 :( |
Is anybody still working on this feature? Do you plan to include it in the next milestone? |
@pkozlowski-opensource The If you are OK with it, I will update this PR accordingly. |
Hi, any update to this issue? |
Hello and Happy New Year Thanks in advance |
@pkozlowski-opensource What is the plan for this PR? Just notice that the 1.0.0 stable version has been released and still not focus trap for the modal. |
Add a11y module which includes:
Most codes are from material 2:
https://github.com/angular/material2/tree/master/src/lib/core/a11y
Apply focus trap to modal dialog to prevent focus "escape" the opened modal
fix:
#1363
#642