react-financial-charts
react-financial-charts copied to clipboard
Chart disappearing after pan
I'm submitting a...
- [x] bug
- [ ] feature
- [ ] chore
What is the current behavior
When I use the mouse to drag a chart back and forth, upon releasing the mouse, the chart will become invisible. This seems to affect every element until it needs to be repositioned. For example, the chart, serious, and axis will become invisible, but upon moving the chart again they will become visible until released. The MouseCoordinateY will reappear as soon as the mouse is moved vertically. The chart is not invisible on the initial render, only after the first movement. All elements will also become visible again once the component rerenders.
What is the expected behavior
The chart does not disappear after panning.
Please tell us about your environment
I'm using Preact 10.5.13, which I suspect may be the cause, however, I very much hope not as I wouldn't like to switch to React. I've replicated the issue on the latest versions of Chrome and Firefox, I'm using version 1.3.1 of react-financial-charts.
Other information
There are no errors in the console, and I don't see any CSS being applied that would cause it to lose visibility.
One thing I've realized is that every single example here is using a Class component, and I'm using Function components. Are they not supported?
Thank you for posting this issue. I am experiencing this bug too. Hopefully to see the author's response. I'm using Preact too.
UPDATE: after removing Preact and switched back to React, everything works fine!!!
UPDATE: after removing Preact and switched back to React, everything works fine!!!
It's good to know that Preact is the root issue here but I'd still really like to see something come of this issue as switching to React is not an option for me unfortunately.
There must be a difference in the way they render/re-render. I can keep it open for one someone has a chance to test in preact but it's not our main target as I've had similar issues with preact and other libraries.