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.

Focus style missing for certain md-buttons in docs #508

Closed
@marcysutton

Description

@marcysutton

In the Angular Material docs, focus styles do not appear on API and Source md-buttons, negatively impacting keyboard accessibility. Upon further investigation, focus events do not seem to fire for these specific buttons, causing .focus classes to not be added when focused. See screenshots of keyboard interaction with md-buttons:

Focus on API <md-button> in toolbar does not show focus style or output to console:

Screenshot 1

Focus on demo example button does show style and output to console:

Screenshot 2

Relevant code from the compile function:

/* Line 80 of src/components/button/button.js */
innerElement
   .addClass('md-button-inner')
   .append(element.contents())
   // Since we're always passing focus to the inner element,
   // add a focus class to the outer element so we can still style
   // it with focus.
   .on('focus', function() {
      console.log(element);
      element.addClass('focus');
   })

@ajoslin any idea why these two instances of <md-button> would behave differently?

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