PolymerElements / paper-icon-button

A Material Design icon button
https://www.webcomponents.org/element/PolymerElements/paper-icon-button
42 stars 44 forks source link

allow disabling PaperInkyFocusBehavior? #113

Closed jab closed 7 years ago

jab commented 7 years ago

We're seeing unwanted keyboard focus-related styles on our paper-icon-buttons, in particular on mobile, where we're specifically only building for the no-keyboard use case. I’ve tracked this down to PaperInkyFocusBehavior, which is unconditionally added to paper-icon-button's behaviors. Would it be possible to allow paper-icon-button users to opt out of PaperInkyFocusBehavior?

(In the meantime, we can work around this by pegging to a fork of paper-behaviors with a modified _focusChanged method. As a bonus, it also works around this issue, which we're also hitting: https://github.com/PolymerElements/paper-menu-button/issues/101)

Thanks for your consideration and for all the great work!

jab commented 7 years ago

(To be clear, we still want the ripple when the button is tapped, we just don’t want the button to get any different styles when it has focus.)

notwaldorf commented 7 years ago

This is bad for a11y, and it's not a thing we'd like to give the option to accidentally turn off :(

jab commented 7 years ago

Thanks for taking a look @notwaldorf! After digging a little deeper, I think this is actually a bug in paper-behaviors. Just opened https://github.com/PolymerElements/paper-behaviors/issues/80, and will close this now since it seems like discussion should move there.