有没有办法降低触发事件 onMouseLeave 或 onMouseOut 的灵敏度。因为我想将它们应用于弹出对话框,除了当鼠标悬停在文本上时它们一直在触发(即 div 标签),只有当我完全冷静下来时它们才不会触发并且弹出对话框是好的. 功能显然可以正常工作,但鼠标事件的敏感性太高了。
这是我最重要的代码部分:
<div className="titleUnderLogo">
<br /> <br />
{applicationDataDefinition.map((item) =>
<div className="titleUnderLogo" onMouseOver = {this.mouseOver} onMouseLeave={this.mouseLeave} /* Tried with this also onMouseOut={this.mouseOut} */ >
{item.name} {item.release} - {item.level} - {item.location}
</div>
)}
<br /> <br />
<Container >
<Dialog
displayed = {showDialog}
title="Product name"
modal={true}
layout="center"
defaultFocus="#ok"
ui="titleUnderLogoCls"
closeAction="hide"
maskTapHandler={this.mouseTapped}
onHide={() => this.setState({ showDialog: false })}
>
{applicationDataDefinition.map((item) =>
<div>
<table>
<tr>
<td> <b> Product name: </b> </td>
<td> {item.name} </td>
</tr>
<tr>
<td> <b> Release: </b> </td>
<td> {item.release} </td>
</tr>
<tr>
<td> <b> Last fix installed: </b> </td>
<td> {item.lastFix} </td>
</tr>
<tr>
<td> <b> Environment: </b> </td>
<td> {item.level} </td>
</tr>
<td> <b> Location: </b> </td>
<td> {item.location} </td>
</table>
</div>
)}
</Dialog>
</Container>
</div>