Way to change price line HitTestThreshold
#1610
Labels
good first issue
Good issue for first-time contributors.
help wanted
Asking for outside help and/or contributions to this particular issue or PR.
polish
Very minor behavior improvement that users will enjoy.
Is your feature request related to a problem? Please describe.
This constant defines the area used to check if a price line is hovered over or clicked. The current value (
7
) is relatively large and causes issues when chart contains several price lines. For example, hovering over one line might unexpectedly returnhoveredObjectId
with another price line id.Demo https://codesandbox.io/p/sandbox/lightweight-charts-skeleton-forked-v6tqm6.
Steps to reproduce:
hoveredObjectId
contains red price line idMaybe the idea of having large number for
HitTestThreshold
was to have better user experience in mobile browsers (so you don't need to tap precisely on the thin line). However, in a desktop browser, it looks more like a bug.Describe the solution you'd like
The simplest solution is to allow to configure a value for the threshold that is currently hardcoded in
HitTestThreshold
constant.For example, for a scenario where charts are used only in desktop browsers, I would disable the threshold at all (i.e. set it to zero).
The text was updated successfully, but these errors were encountered: