-
-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we fire the setCursor hook when a cursor becomes locked? #921
Comments
looking back at the line history i can't find a specific reason for skipping the update during locking. maybe was before hooks existed and this was just a micro-optimization to avoid an unnecessary cursor update to the same position it was already at 🤷. i tried to see if just removing the it'll be few weeks before next release is out, so feel free to use the |
@leeoniya Thank you very much for the quick fix. uPlot is an awesome library 👍 |
thanks :) |
@leeoniya I just realized this does not work perfectly. If you try to lock a cursor in the Sync Cursor demo then unlock, the unlocked cursor is not synced correctly. You can test reproduce this by either click on the same plot to unlock or unlock in a different plot, these two cases will both have incorrectly synced cursors, but in different ways. |
I found another minor bug related to locked cursors,
|
I noticed the setCursor hook was not fired after the cursor is locked:
https://github.com/leeoniya/uPlot/blob/master/src/uPlot.js#L3190
More Context:
I'm trying to implement a feature that locks the tooltip like the one in https://leeoniya.github.io/uPlot/demos/candlestick-ohlc.html I'd like the tooltip to be locked and not to be hidden even if the user exits the plot after the cursor is locked.
I'm also considering displaying more detailed information in the tooltip after the cursor is locked.
I'm more than happy to submit a PR if you think this makes sense, thanks!
The text was updated successfully, but these errors were encountered: