victory icon indicating copy to clipboard operation
victory copied to clipboard

sharedEvents in victoryChart disappears after initial interaction

Open howdykevin opened this issue 3 years ago • 1 comments

Bugs and Questions

Checklist

  • [x] This is not a victory-native specific issue. (Issues that only appear in victory-native should be opened here)

  • [x] I have read through the FAQ and 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

After initial interaction( toggle once): image 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

howdykevin avatar Jul 13 '21 01:07 howdykevin

I've skimmed through the diff, the bug seems to be introduced here: https://github.com/FormidableLabs/victory/pull/1789

Wesleyzxc avatar Aug 05 '21 07:08 Wesleyzxc