FormidableLabs / FormidableLabs/victory

sharedEvents in victoryChart disappears after initial interaction

Open
#1,900 1 comment 0 reactions 0 assignees View on GitHub
Issue: Accepted Type: Bug :bug:
Dominant language
TypeScript
Stars
11.2k
Forks
536
PR merge metrics
No merged PRs in 30d

Description

# Bugs and Questions

### Checklist

- [x] This is not a `victory-native` specific issue. (Issues that only appear in `victory-native` should be opened [here](https://github.com/FormidableLabs/victory-native/issues/new))

- [x] I have read through the [FAQ](https://formidable.com/open-source/victory/docs/faq) and [Guides](https://formidable.com/open-source/victory/guides/) before asking a question

- [x] I am using the latest version of Victory

- [x] I've searched open issues to make sure I'm not opening a duplicate issue

### The Problem

I have a chart that can be toggled on/off( show or hide) upon clicking its legend(VictoryLegend). After updating my package from 35.4.8 to the latest victory library package, my events seem to have disappeared after initial interaction. I am unable to toggle my chart continuously. i can only do it once

Initial render:(my sharedEvents exist)
![image](https://user-images.githubusercontent.com/20341017/125377629-a4a65900-e3d0-11eb-8c6b-08a52a7fc0e1.png)

After initial interaction( toggle once):
![image](https://user-images.githubusercontent.com/20341017/125377716-d1f30700-e3d0-11eb-85b0-2e11db0dd766.png)
sharedEvents props disappeared

Downgrading my victory version back, seems to enable my toggle event to work again. Is there any breaking changes from 35.4.9 onwards with regards to how events are supposed to be used? Or am i using handling events wrongly?

Any help would be much appreciated :)

### Reproduction

I have created a demo codesandbox:
https://codesandbox.io/s/cranky-meadow-fmgjh?file=/src/App.js

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.