PolymerElements / paper-button

A button à la Material Design
https://www.webcomponents.org/element/PolymerElements/paper-button
138 stars 64 forks source link

Button with input focus sometimes appears bold after switching tabs #29

Closed grokys closed 8 years ago

grokys commented 9 years ago

In Chrome 43, sometimes after clicking a button then changing tabs in Chrome or changing to a different application, the button will appear bold until clicked again. This can be seen on the demo page.

kungufli commented 9 years ago

This bug was already reported in the past (https://github.com/PolymerElements/paper-button/issues/24), and is still present in the latest 1.0.3 version of the element. Also, it affects (at least) paper-icon-button, paper-checkbox, paper-radio-button and paper-slider too. @notwaldorf @cdata Any news on this?

ilin-t commented 9 years ago

The bug still exists. I tried with disabling and then enabling the button after the on-click method is finished but it still did not work. It is also happening on when browsing the apps from smartphones and tablets. Is there any feedback from google, or maybe you have some suggestion how to temporarily fix this ?

notwaldorf commented 9 years ago

The problem is that this behaviour isn't entirely incorrect. After clicking the button, it stays focused (this is also true of native buttons). When you switch to a different tab, and then back to the original one, the button is styled as if it's focused, which it technically is.

Here's a demo of the native HTML button doing this as well: http://output.jsbin.com/bijukuqofo

/@cdata for input/to tell me i'm wrong :)

motss commented 9 years ago

can try to eliminate the bold font by explicitly setting the font-weight of the focused paper-button to normal

joshheinrichs commented 9 years ago

You can add this CSS to get rid of the bold:

paper-button::shadow .keyboard-focus {
    font-weight: normal;
}
cdata commented 8 years ago

Closing this as a dupe of #24.