components icon indicating copy to clipboard operation
components copied to clipboard

Weird ripple effect

Open BenevidesLecontes opened this issue 10 years ago • 36 comments

Bug, feature request, or proposal:

[x] Bug

What is the expected behavior?

Expecting ripple effect on buttons

What is the current behavior?

On click ripple effect makes my button wide and ripple color appears like in image below

screen shot 2016-08-09 at 17 36 47 #### What are the steps to reproduce?
<button md-button md-ripple [md-ripple-color]="rippleColor" (click)="openSideNav($event)"  type="button"
                *ngIf="navigationUrl!=='/' && navigationUrl!=='/login'">
            <md-icon>menu</md-icon>
        </button>

Providing a Plunker (or similar) is the best way to get the team to see your issue.

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, browsers are affected?

Angular material alpha.7, chrome 52.0.2743.116 (64-bit) MacOS Sierra

Is there anything else we should know?

I'm trying to use the ripple effects on buttons am I missing something? I have my imports like this:

imports: [
        BrowserModule,
        MdCardModule,
        MdInputModule,
        MdIconModule,
        MdListModule,
        MdSidenavModule,
        MdToolbarModule,
        MdButtonModule,
        MdTabsModule,
        MdRippleModule,
        ReactiveFormsModule,
        MdMenuModule,
        FormsModule,
        RouterModule.forRoot([...routes], {})
    ]

BenevidesLecontes avatar Aug 09 '16 20:08 BenevidesLecontes

Hi,

I am experiencing the same issue in my angular 2 app and was wondering how I can get hold of the core.css file that @ivoviz claims will solve this issue?

Alternatively, can anyone give me an ETA as to when this is officially likely to get fixed?

Thanks in advance

Mufasa avatar Aug 12 '16 01:08 Mufasa

It is in node_modules/@angular2-material/core

jelbourn avatar Aug 12 '16 01:08 jelbourn

styleUrls: [
    '../../node_modules/@angular2-material/core/style/core.css',
    '../../node_modules/@angular2-material/core/overlay/overlay.css',
    '../../public/styles/main.scss'
]

sspilleman avatar Aug 14 '16 09:08 sspilleman

Thanks both - that fixed my issue.

BTW: I had also reported this at Google Groups - angular-material2 and have mentioned these work-arounds there as well.

Mufasa avatar Aug 14 '16 12:08 Mufasa

@jelbourn @sspilleman it doesn't work for me on alpha7-4. The issue persists even after loading those css files

xhite avatar Aug 18 '16 10:08 xhite

@xhite Maybe because of #1004?

colinfang avatar Aug 18 '16 11:08 colinfang

You should load the css files with a <link> element rather than styleUrls in a component.

alpha.7-4 isn't all the way up to master; it only includes very minor changes that won't affect most users (in this case fixing an issue with ngc running on the ripple).

jelbourn avatar Aug 18 '16 15:08 jelbourn

@jelbourn thanks it works when loading globally with <link>

xhite avatar Aug 18 '16 16:08 xhite

Also you can just disable ripple for a while

<button md-mini-fab [disableRipple]="true">
    <md-icon>add</md-icon>
</button>

mentatxx avatar Aug 20 '16 18:08 mentatxx

@jelbourn If you get the chance, please state briefly why you chose to put the styles in a separate CSS that we have to link to, rather than stay consistent with Angular's isolated scopes approach that keeps styles within the block scope of their component. Is this just temporary?

RoxKilly avatar Aug 26 '16 11:08 RoxKilly

There are some styles that are used between multiple components (such as ripples), so including them directly in the component css instead of globally would lead to a pretty sizable chunk of duplicate payload.

jelbourn avatar Aug 30 '16 16:08 jelbourn

Closing into #1139

jelbourn avatar Aug 31 '16 01:08 jelbourn

Using rc5 and m2 alpha7-4, md-menu html like this:

     <md-menu>
          <button md-menu-item> Refresh </button>
          <button md-menu-item> Settings </button>
          <button md-menu-item> Help </button>
          <button md-menu-item disabled> Sign Out </button>
      </md-menu>

showed like this after rendering:

  <md-menu _ngcontent-dup-2 role="menu">
       <!--template bindings={}-->
       <!--template bindings={
            "ng-reflect-ng-if":"false"
           }--->
  </md-menu>

include <link rel="stylesheet" href="vendor/@angular2-material/core/style/core.css" /> in index.html nothing changed.

mgpeng avatar Sep 02 '16 13:09 mgpeng

Currently (angular 2.0, material 2.0.0-alpha.9) the solution is to include theme in styles.css like:

/* You can add global styles to this file, and also import other style files */
@import '../node_modules/@angular/material/core/theming/prebuilt/indigo-pink.css';

KKrisu avatar Oct 02 '16 14:10 KKrisu

I'm also with angular 2.0, material 2.0.0-alpha.9 a solution is to create theme doc and link to your project.

We need to @include md-core();

alexlevy0 avatar Oct 13 '16 22:10 alexlevy0

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.