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.

md-button that reveals dialog continues to display focus styled when returned #4945

Closed

Description

@joeyperson

It seems like the originating button intermittently gets the gray background when returning from a dialog.
https://codepen.io/anon/pen/qORpvo

In the demo it is happening only sometimes, but in another project, it's showing every time.

Focus should be kept, but it should be visually suppressed because it is a mouse event and doesn't require immediate keyboard affordance.

Expected:

  • No focus highlight remains after clicking
  • Press Tab a few times with visible focus
  • Then click anywhere and watch it visible focus disappear

Activity

  1. EladBezalel commented on Oct 1, 2015

    @EladBezalel
    Member

    Can confirm, occurs only when clicking on a button that closes the dialog or pressing ESC, when clicking outside the button losses his focus

  2. marcysutton commented on Oct 1, 2015

    @marcysutton
    Contributor

    Focus is being sent back to the triggering button on purpose–so that a keyboard or screen reader user will be directed to the correct content. This is the intended behavior.

  3. EladBezalel commented on Oct 1, 2015

    @EladBezalel
    Member

    So @marcysutton this is not a bug and can be closed?

  4. marcysutton commented on Oct 1, 2015

    @marcysutton
    Contributor

    Sounds like it! I will close.

  5. chriscalo commented on Oct 5, 2015

    @chriscalo

    On Mac OS X, clicking on push buttons or checkboxes does not steal focus from other controls. They can still be focused via the keyboard, so there's no accessibility issue.

    http://sendvid.com/2gweiimg

    In my humble opinion, the same is desirable on the web. This can be achieved on push buttons via event.preventDefault() on mousedown.

  6. marcysutton commented on Oct 15, 2015

    @marcysutton
    Contributor

    Unfortunately we do not have the same primitives on the Web as native platforms do. If you're curious about the limitations surrounding this issue, read up on CSS Input Modality. I think Angular Material will have to implement something similar to @alice and @bkardell's prollyfill since the perceived "bug" will just keep coming up again and again and again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions