Skip to content
This repository has been 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 opened this issue Oct 31, 2014 · 1 comment
Closed

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

marcysutton opened this issue Oct 31, 2014 · 1 comment

Comments

@marcysutton
Copy link
Contributor

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?

@marcysutton marcysutton changed the title Focus event does not fire for certain md-buttons in docs Focus style missing for certain md-buttons in docs Oct 31, 2014
@marcysutton
Copy link
Contributor Author

Recommending a refactor for <md-button> to use a native button element. @ajoslin we should be able to nest the ink-ripple and other child elements safely inside a <button>, correct?

@ajoslin ajoslin closed this as completed in d835f9e Nov 6, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant