-
Notifications
You must be signed in to change notification settings - Fork 3.4k
md-button stays focused after a click #556
Comments
This may be intentional can any designers comment? I've seen this in bootstrap and have removed disabled it before but it may be helpful to know the last button you clicked. I'm still back and forth about it maybe it should be an option you could enable if some people want this. |
There are changes to |
I get that the focused state has to stay enabled for a little bit, but now I get the impression that the action that the button is supposed to do (say, load more content on the page) is not finished, as the button stays "clicked". |
I'm not saying remove the focus style. I think @PaulMougel and myself are refering to when you click a button it shouldnt have focus until you click something else. After you click it should be the same as before you clicked it. The argument against have it like how it is now is that there may be benefits in seeing the last button you clicked easily. |
Gotcha. We'll take a closer look, that does sound odd. I've just seen focus styles removed entirely for reasons like this. |
It shouldn't have the focus style when you click, but the button is actually focused. That's how a native button works. There are major changes coming to Updated with a really basic Codepen where we can check native button focus behavior: http://codepen.io/marcysutton/pen/jDKlf |
@PaulMougel you can make it a non styled focus where tab would still work and have the right position after a click but it wouldnt have the focused style. I think we should come back to this after the |
Alright, let's wait for the refactoring then :) Thanks a lot for the quick answers! |
Apparently this is a larger issue, and quite difficult to solve cross-platform. Leaving this here for reference: https://twitter.com/patrick_h_lauke/status/530503642399666177 |
The standard is to give focus to buttons when clicked. The default browser style for :focus is a dashed outline. The default :hover style is a darker shade in the button. The two states have very different appearances. Two ways to resolve this issue would be:
|
I also noticed the sliders work the same way. It keeps focus after you click on it until you click somewhere else. Maybe this is intentional as I've seen it on several websites too. |
I don't mind having a click event on a button setting focus. What if I want also if we want to auto switch focus, its nontrivial to decide what is the I think the individual click handlers should be in charge of switching
|
Also, if md-tooltip is added to the button, it stays visible while the button has focus. That is definitely not the standard. |
|
+1 for differentiating :focus styles from the :hover ones, at least |
Focus styles are covered in a different issue: #142 |
bump |
Does anyone know how to disable md-button hover effect? |
.md-button:not([disabled]):hover {
background-color: transparent;
} |
What's the exact solution to this issue? I'm still getting this in my application. When switching tab and coming back to application, button is still showing active. |
@marcysutton I think this issue should still be open. The linked issue has been closed without a resolution to this one... |
@simhnna I don't work on Angular Material anymore, but I'd recommend looking into the proposed |
For the ppl that still wants to get rid of it in the last versions of Angular Material (5.2.3 in my project) you can do the next: |
@AngelQuirogaM Please submit Angular Material questions here and issues here. This repo is for AngularJS Material. |
@AngelQuirogaM the problem with that CSS is you're hiding the visible focus state, which means keyboard users can't see where we are on the screen (a huge accessibility/usability problem). It doesn't get at the core issue, which is that mouse users don't like the persistent focus state. See my above comment for a better way forward. |
After clicking or touching on a
<md-button>
, it stays focused, both on latest Firefox, Chrome, mobile Chrome and mobile Safari (see the demo page). Only by clicking somewhere else will the button loose focus. Is it the intended behavior?Screenshot in latest Chrome stable, on Mac Os Yosemite, on the demo page:
The text was updated successfully, but these errors were encountered: