Weird ripple effect
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
#### 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], {})
]
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
It is in node_modules/@angular2-material/core
styleUrls: [
'../../node_modules/@angular2-material/core/style/core.css',
'../../node_modules/@angular2-material/core/overlay/overlay.css',
'../../public/styles/main.scss'
]
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.
@jelbourn @sspilleman it doesn't work for me on alpha7-4. The issue persists even after loading those css files
@xhite Maybe because of #1004?
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 thanks it works when loading globally with <link>
Also you can just disable ripple for a while
<button md-mini-fab [disableRipple]="true">
<md-icon>add</md-icon>
</button>
@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?
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.
Closing into #1139
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.
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';
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();
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.