Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

dialog: shift+tab doesn't loop properly after it reaches the beginning #10963

Closed

Description

@frkfir

Actual Behavior:

  • `What is the issue? *
    shift+tab doesn't work properly when md-dialog opens.
    Can't go to the last element/button etc.. that appear on this dialog.
    It get lost. only Tab key works has expected.
  • `What is the expected behavior?
    shift+tab will work properly when md-dialog opens and get to the last ellement/button etc that appear on the dialog.
    It's supposed to behave in a circular way. (looped)

CodePen (or steps to reproduce the issue): *

AngularJS Versions: *

  • `AngularJS Version: 1.1.5
  • `AngularJS Material Version: 1.1.2 and also happens on 1.1.5

Additional Information:

  • `Browser Type: * Chrome, Firefox, Explorer etc...
  • `Browser Version: * Chrome Version 62.0.3202.75 (Official Build) (32-bit)
  • `OS: * Windows 7
  • `Stack Traces: N/A

Shortcut to create a new CodePen Demo.
Note: * indicates required information. Without this information, your issue may be auto-closed.

Do not modify the titles or questions. Simply add your responses to the ends of the questions.
Add more lines if needed.

Activity

  1. EladBezalel commented on Nov 27, 2017

    @EladBezalel
    Member

    @Splaktar do you mind taking a look at that?

  2. changed the title [-]shift+tab doesn't work properly when md-dialog opens.[/-] [+]shift+tab doesn't loop properly after it reaches the beginning in a dialog[/+] on Nov 29, 2017
  3. added
    needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or community
    P2: requiredIssues that must be fixed.
    a11yThis issue is related to accessibility
    on Nov 29, 2017
  4. added this to the 1.1.6 milestone on Nov 29, 2017
  5. Splaktar commented on Nov 29, 2017

    @Splaktar
    Contributor

    I'm able to reproduce. It loops fine when going forward, but when going backwards it just stops at the 1st tabindex and never loops over to the last tabindex.

  6. modified the milestones: 1.1.6, 1.1.7 on Jan 17, 2018
  7. modified the milestones: 1.1.7, 1.1.8 on Jan 29, 2018
  8. removed this from the 1.1.8 milestone on Mar 16, 2018
  9. 21 remaining items

  10. modified the milestones: 1.2.1, 1.2.2 on Sep 14, 2020
  11. self-assigned this
    on Dec 15, 2020
  12. removed
    needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or community
    on Dec 15, 2020
  13. Splaktar commented on Dec 15, 2020

    @Splaktar
    Contributor

    Screen Shot 2020-12-15 at 15 33 50
    We have the above structure with top and bottom focus traps.

    Our logic for "redirecting" the focus is flawed:

    var focusHandler = function() {
    element.focus();
    };

    The bottom focus trap moves the focus to the md-dialog and the next tab moves the focus to the first focusable element in the dialog (button in this case).

    The top focus trap moves the focus to the md-dialog and the next shift+tab moves the focus to the md-dialog. So it just gets stuck there.

  14. Splaktar commented on Dec 15, 2020

    @Splaktar
    Contributor

    I've been investigating pulling in _getFirstTabbableElement() and _getLastTabbableElement() from cdk/a11y/focus-trap since we currently have no way of getting the last focusable element in a dialog. However, it means that I have to pull in most all of InteractivityChecker as well.

    I can avoid pulling in @angular/cdk/platform, so thankfully the web doesn't expand any further than that.

    I've currently got this running and refactored a bit to work as part of $mdUtil, but currently $mdUtil.getLastTabbableElement(element[0]) is always returning null. I'm working on debugging this atm.

  15. added 2 commits that reference this issue on Dec 16, 2020
    9f25436
    81c9b22
  16. added a commit that references this issue on Dec 16, 2020
    7d5e262
  17. added a commit that references this issue on Sep 28, 2024
    a8878ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions