Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

md-button md-focused bug #4329

Closed
hodeyp opened this issue Aug 26, 2015 · 2 comments
Closed

md-button md-focused bug #4329

hodeyp opened this issue Aug 26, 2015 · 2 comments
Assignees
Milestone

Comments

@hodeyp
Copy link

hodeyp commented Aug 26, 2015

I have an md-button with the following structure...

<md-button aria-label="New Transit" ui-sref="app.newtransit" class="md-icon-button">
  <md-tooltip>New Transit</md-tooltip>
  <md-icon>add</md-icon>
</md-button>

I believe expected behaviour is that when the cursor hovers over the button it displays a background colour of rgba(158,158,158,0.2). When the mouse leaves the button it returns to transparent.

What is actually happening is that the button background remains transparent when the cursor hovers over the button, and then adds the rgba(158,158,158,0.2) when the mouse leaves the button.

Observing what classes are being added, when the mouse hovers, the following styles are added...

a.md-button:not([disabled]).md-icon-button:hover, .md-button:not([disabled]).md-icon-button:hover {
    background-color: transparent;
}

a.md-button:not([disabled]):hover, .md-button:not([disabled]):hover {
    background-color: rgba(158,158,158,0.2);
}

The first of these entries looks to be wrong to me as it is overriding the second item.

When the mouse is no longer hovering, the following style is applied....

a.md-button:not([disabled]).md-focused, .md-button:not([disabled]).md-focused {
    background-color: rgba(158,158,158,0.2);
}

Checking the classes added to the button, md-focussed is indeed added to the button when the mouse hovers over the button, but is not removed when the mouse is no longer hovering.

@hodeyp hodeyp changed the title md-button md-focussed bug md-button md-focused bug Aug 26, 2015
@Frank3K
Copy link
Contributor

Frank3K commented Aug 26, 2015

Related: #4249.

@ThomasBurleson ThomasBurleson modified the milestone: 0.12.0 Sep 2, 2015
Androguide added a commit to Androguide/material that referenced this issue Sep 11, 2015
md-button was retaining focus on mouseleave, this was especially visible on buttons with tooltips that get focused on hover (see angular#4249).

Fixes angular#4249 angular#4329
@topherfangio
Copy link
Contributor

According to the spec (http://www.google.com/design/spec/components/buttons.html#buttons-toggle-buttons), icon buttons do not have a hover effect, only a focus/click effect.

You have made this an icon button by adding class="md-icon-button".

Closing for now, please comment if you feel like we should re-open.

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

4 participants