question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Canvas only GenericComponent disappears

See original GitHub issue

Hello!) I want to implement canvas-only version of some tooltip:

class VisibleDataAggregationTooltip extends Component {
  constructor(props) {
    super(props)
    this.drawOnCanvas = this.drawOnCanvas.bind(this)
  }

  drawOnCanvas(ctx, moreProps) {
    drawOnCanvas(ctx, this.props, this.context, moreProps)
  }

  render() {
    return <GenericComponent
      canvasDraw={this.drawOnCanvas}
      clip={false}
      drawOnMouseMove
      drawOnPan
      drawOnMouseExitOfCanvas
    />
  }

}

So, I expect the tooltip will be visible all the time. But it is disappearing randomly when mouse leaves the canvas…

dissapearing-tooltip

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rragcommented, Jan 25, 2017

in the next branch I am working on creating canvas based interactive components, and I have done the changes suggested earlier there

1reaction
rragcommented, Jan 19, 2017

are you trying this on master?

this must have addressed the inconsistency, so it is cleared everytime mouse exits. I think it was broken in 0.6 but fixed in 0.6.1

can you try this and see if that does not break anything and also addresses this?

handleMouseLeave(e) {
	this.clearMouseCanvasOnly();
	this.triggerEvent("mouseleave", { show: false }, e);
+	this.triggerEvent("draw")
}

https://github.com/rrag/react-stockcharts/blob/master/src/lib/ChartCanvas.jsx#L382-L385

But why tooltip on canvas? I mean, when I wanted a complete canvas version I was having html tooltip in mind. using div/span.

Read more comments on GitHub >

github_iconTop Results From Across the Web

html5 canvas element disappears - javascript - Stack Overflow
Thanks for this tip. My issue is that the canvas element disappears with or without the text in that div. I have just...
Read more >
Create canvas app dataset component in Microsoft Dataverse
In this tutorial, learn how to create a canvas app dataset code component, and deploy, add to a screen, and test the component...
Read more >
How to disable (hide) UI elements without disabling them
I'm just moving them to a non-canvas GameObject by changing their parent (I remembered from the vids that GUI objects only get rendered...
Read more >
Create a disappearing section on your Retool canvas
This is a technique whereby we make a section disappear and the page shrinks to take up the space. It simulates an expanding...
Read more >
Canvas - Scripting API - Unity - Manual
preWillRenderCanvases, Event that is called just before Canvas rendering happens. ... gameObject, The game object this component is attached to.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found