Hide hovertip on mouseleave

This commit is contained in:
Jamie Wong 2017-12-29 22:07:27 -05:00
parent 0644f16814
commit 17df504205
2 changed files with 7 additions and 2 deletions

View File

@ -16,7 +16,6 @@ export const style = StyleSheet.create({
background: 'white',
border: '1px solid black',
maxWidth: Sizes.TOOLTIP_WIDTH_MAX,
overflow: 'hidden',
paddingTop: HOVERTIP_PADDING,
paddingBottom: HOVERTIP_PADDING,
pointerEvents: 'none',
@ -27,7 +26,7 @@ export const style = StyleSheet.create({
hoverTipRow: {
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
overflow: 'hidden',
overflowX: 'hidden',
paddingLeft: HOVERTIP_PADDING,
paddingRight: HOVERTIP_PADDING,
maxWidth: Sizes.TOOLTIP_WIDTH_MAX,

View File

@ -458,6 +458,11 @@ export class FlamechartPanZoomView extends ReloadableComponent<FlamechartPanZoom
this.renderCanvas()
}
private onMouseLeave = (ev: MouseEvent) => {
this.props.setNodeHover(null, new Vec2())
this.renderCanvas()
}
private onWheel = (ev: WheelEvent) => {
ev.preventDefault()
this.frameHadWheelEvent = true
@ -513,6 +518,7 @@ export class FlamechartPanZoomView extends ReloadableComponent<FlamechartPanZoom
className={css(style.panZoomView, style.vbox)}
onMouseDown={this.onMouseDown}
onMouseMove={this.onMouseMove}
onMouseLeave={this.onMouseLeave}
onWheel={this.onWheel}>
<canvas
width={1} height={1}