Closed lucianbaciu closed 1 year ago
i'm not able to reproduce this. can you make a screen rec of it happening with this fiddle?
https://jsfiddle.net/s5vnq2ht/
it only happens on chart init for me, so maybe something in your code is re-initializing the plot?
Yes. it happens in this fiddle too. I will come back with the rec
I did some more testing, and it is triggered when you switch between chrome windows. In this example I just click on the google page, then on the chart, then google, etc.. Every time I get back to the chart the setSelect is called. This happens also when you click on a DevTools window (inspector)
Tested on Mozilla. It can't be reproduced, so I think we can say it happens just in google chrome
i'm not sure what's going on in your case. at least on Linux, Chromium 107 (Incognito) it works okay. i'll try on windows in a bit. the extreme cursor lag in your screen rec is concerning, there should be almost no lag like in my rec below. maybe you have some misbehaving Chrome extensions. try the same in Incognito mode (with all extensions disabled).
https://user-images.githubusercontent.com/43234/203643065-fc9a1de1-18a7-40f3-a334-06ad0ede2ca7.mp4
ok, i got it to fail on windows. :bomb: :window:
now need to figure out whose bug it is, mine or Google's.
glad to hear that! I was planning to test on a different browser. The issues is if you have a ranger, the selection is badly affected.. otherwise I'd ignore it.
looks like a Chrome bug, i'll have to put together a minimal repro to file a bug with them.
at least the work-around did not end up being too miserable. should be fixed now, can you try the same fiddle again?
I managed to reproduce it every ~20 clicks (with or without moving to another window). I think it is fine. Most likely this will not happen in a real environment. Thank you!
the fix for this broke mobile cursor moves in Chrome-based browsers, so needed another work-around to unbreak it: https://github.com/leeoniya/uPlot/commit/9a3db41d254f80e8be3e44841baf7f35f3ccc85d
I have one of the simplest sin chart (one of your example).
hooks: { setSelect: [(uplot) => { console.log('SET SELECT'); }],}
If you click on something outside of the browser, then come back and click the chart, this event will be fired. You can do this as many times as you want. I'm not sure this is a normal behaviour and I think it's not. It is causing issues when dealing with more complex situations like linked charts, ranger, etc. Thank you!