Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Button ripple effect bug!? #489

Open
edelgarat opened this issue Jun 12, 2017 · 0 comments
Open

Button ripple effect bug!? #489

edelgarat opened this issue Jun 12, 2017 · 0 comments

Comments

@edelgarat
Copy link

After changing the value of the button, the ripple effect stops working:

import * as MDL from "react-mdl";
const { Button } = MDL;
class App extends React.Component {
	constructor() {
		super();
		this.state = { a: true };
		this.onBtnClick = this.onBtnClick.bind(this);
	}
	onBtnClick() {
		//this.setState({ a: !this.state.a });
		setTimeout(() => this.setState({ a: !this.state.a }), 100);//delay for drawing ripple effect
	}
	render() {
		return <div>
			<Button ripple style={{backgroundColor:"lightgreen"}} onClick={this.onBtnClick}>{this.state.a ? "1" : "2"}</Button>
		</div>;
	}
}
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

1 participant