我在fusioncharts
列的工具提示中遇到此问题。将鼠标悬停在列上时,工具提示会正常显示,但是当我拖动包含图表的div时,工具提示会在错误的位置显示(它会显示列所在的位置)。我正在使用react
,react-fusioncharts
,react-draggable
。下面的代码:
<Draggable
onDrag={isEdit && this.handleDrag.bind(this, item, index)}
key={item.id}
position={{x: item.x, y: item.y}}
grid={[1, 1]}
bounds="parent"
>
<div
style={{
position: 'absolute',
zIndex: item.zIndex}}
>
<div>
{
this.renderComponent({item: item, index: index}, currentPage)
}
</div>
</div>
</Draggable>
另一部分代码:
renderComponent(widget, pagina) {
if (widget.item.componente) {
let componente = listaComponentes.find(c => c.widget === widget.item.componente.widget); //We have a list of charts[enter image description here][1]
return (
<div>
<div key={'widget' + widget.item.id + pagina} id={'widget' + widget.index} onMouseDown={this.handleEditClick.bind(this, widget.item.id)} onContextMenu={event => event.preventDefault()}>
{
React.createElement(componente.objeto, {
widget: widget,
mode: this.props.mode,
handleClickedWidgetId: this.handleClickedWidgetId.bind(this, widget.item.id),
clickedWidgetId: this.state.clickedWidgetId,
pagina: pagina
})
}
</div>
</div>
);
}
}