My child is preventing calling parent method when onMouseOver occurs. To better understand problem I'm adding code snippet and what I want to achieve.
renderDropdown(){
let dropState = !this.state.dropdownActive;
this.setState({dropdownActive: dropState})
}
<li key={item.class} onMouseOver={this.renderDropdown} onMouseLeave={this.renderDropdown}>{this.state.dropdownActive ? <div className="toolbar-dropdown"></div> : null}<i className={`fas ${item.class}`}></i></li>
When I hover on li element everything works as expected but when hover appears on <i>
element method is not called. So the <i>
element is covering the li
method. How to fix this ?