I am using ReactJS and Google's Material components for the web using RMWC (https://github.com/jamesmfriedman/rmwc). I have a parent component which contains an icon and a text under it. This icon has Material Design Ripples effect on it, which means that when I hover it or click it, an animation is triggered.
I would now like to trigger that same effect when I hover or click on the text that is under.
Here is the component:
export class Subject extends Component {
constructor(props) {
super(props)
}
triggerRippleHover() {
console.log("hovered");
// HERE
}
renderSubjectIcon(Icon) {
return (
<Icon className="subject-icon" />
)
}
render() {
return (
<div className="subject-container">
<Ripple unbounded>
<div className="subject-icon-container">
{this.renderSubjectIcon(this.props.icon)}
</div>
</Ripple>
<span onMouseEnter={this.triggerRippleHover}>{this.props.name}</span>
</div>
)
}
Basically, I just want to "extend" the zone that triggers the behavior of the icon (if that makes any sense).
I have been searching extensively but haven't been able to find an appropriate answer.
Thanks a lot for your help.