question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Button waves do not disappear after click

See original GitHub issue

Here is an example of a button that was pressed. As you can see, the lightening due to the wave does not disappear after click. The button is defined as <button id="uploadphoto" class="waves-effect waves-light btn">Upload Photo</button>

The same issues does not occur when using the materialize:materialize package. This suggests that it is an issue with the Sass compilation. I compiled v0.97.5 Sass with fourseven:scss for Meteor. It may be an issue with Libsass incompatibility with older indented sass syntax as mentioned in the README of fourseven/meteor-scss.

screen shot 2016-01-16 at 7 04 37 pm

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

90reactions
heneryvillecommented, Feb 18, 2016

You’ll get this behavior if you’ve included the materialize javascript more than once on the page.

3reactions
OzzyTheGiantcommented, Nov 29, 2018

You’ll get this behavior if you’ve included the materialize javascript more than once on the page.

If you’re on angular and you can’t use ngx-materialize (because it hasn’t been updated to be compatible with materialize-css 1.0), and you need to M.Init() some components, remove materialize.min.js from your scripts in the angular.json file and import * as M and then add M as a provided value in a ‘shared’ module that you can import across your app. You then @Inject() it into whatever component you need so that you can M.AutoInit() during your lifecycle hooks. Doing this will prevent materialize from being imported several times. Here’s a sample shared.module.ts file:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import * as M from 'materialize-css/dist/js/materialize';

@NgModule({
	imports: [
		CommonModule
	],
	declarations: [],
	providers:[
		{provide:'M', useValue:M}
	],
  	exports: [
		  CommonModule
	]
})
export class SharedModule { }

your component would look something like this (I’m using a materialize modal dialog box component):

import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit, Inject } from '@angular/core';
import * as M from 'materialize-css/dist/js/materialize';

@Component({
    selector: 'dialog-box',
    templateUrl: './dialog-box.component.html',
    styleUrls: ['./dialog-box.component.scss']
})
export class DialogBoxComponent implements OnInit, AfterViewInit, OnDestroy {
    @ViewChild('dialogBox') elementRef: any;
    materializeBinding: any;

    constructor(@Inject('M') private M: any) {}

    ngOnInit() {}

    open() {
        this.materializeBinding.open();
    }

    ngAfterViewInit() {
	this.materializeBinding = M.Modal.init(this.elementRef.nativeElement);
    }

    // ...other code omitted for brevity
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Buttons not disappearing after clicking them - Stack Overflow
The button doesn't disappear because it's still being rendered. In order to have it rendered conditionally, you need to specify a condition on ......
Read more >
Fixed issues in Premiere Pro - Adobe Support
Learn about fixed issues in Premiere Pro. Know how to fix problems with Adobe Premiere Pro. Use this document for bug fixes in...
Read more >
Remember to Rescan | Federal Communications Commission
More videos on YouTube ; Hitachi. Click the "Menu" button. Select "Channels". Then click "Air". You will be asked "Are you sure you...
Read more >
Video: Animate text - Microsoft Support
Training: You can animate anything in three steps. Select what you want to animate, select an animation, and tweak it with an effect...
Read more >
InfoPath Forms Buttons disappear in Read Mode
I ran into the same problem but I was using the InfoPath Web Part in a custom page so this solution may not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found