-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is it possible to manually trigger ripple on a button from the containing component? #995
Comments
We used to be able to do this by reaching into the Right now, I created my own version of |
I added it back in and made a few changes to make it compatible with all the buttons. Let me know what you think, and if you can come up with a better/cleaner way. Usage: var Component = React.createClass({
doRipple() {
if (this.refs.iconButton && this.refs.iconButton.refs.button) {
this.refs.iconButton.refs.button.start();
setTimeout(() => {
if (this.refs.iconButton && this.refs.iconButton.refs.button) {
this.refs.iconButton.refs.button.end();
}
}, 1000); // hold for one second
}
}
render() {
return <IconButton ref="iconButton" />;
}
}); The refs.xxx.yyy() pattern might be deprecated and it looks hackish so I'm hesitant on making a pull request. |
@jackphel I wonder if you could use the React TestUtils to simulate a button click.. https://facebook.github.io/react/docs/test-utils.html#simulate Closing for now as this has been sitting for too long and @conundrumer suggested some sort of a workaround. Feel free to comment if you would like to discuss more! |
Is there a way to apply the TouchRipple effect/component to a custom element/component? (I know the TouchRipple component is available in the internal directory) |
If I have:
is there a quick way to make the ripple effect occur from the commented line without incurring
onClick
?The text was updated successfully, but these errors were encountered: