question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disabling scrolling by disabled `horzTouchDrag` and `vertTouchDrag` options disables moving crosshair in tracking mode

See original GitHub issue

The horzTouchDrag and vertTouchDrag properties for mobile right now allow for the user to perform touch and drag movements, but as far as I can tell there is no way to allow movements of only the crosshair on mobile. If I disable scrolling, or set the horzTouchDrag and vertTouchDrag to false, I lose the ability to freely move around the crosshair.

Is there any way on a mobile device to still allow for free movement of the crosshair while disabling scrolling for the chart itself?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
timocovcommented, Sep 22, 2020

I think it depends on fixes from #106, so postpone it for now until we’ll fix that issue (I guess it will be right after 3.2).

0reactions
Rishabh-Streakcommented, Aug 4, 2020

i need to long press and then drag to move crossHair … but for my use case i want chart scroll to be disabled and i only want to move crosshair

@Rishabh-Streak I think this is by design and we don’t have a plan to change it in the future. It’s just mobile UX which is better (I think so) than like you’ve described (we’ve had exactly the same previously on all our charts and we decided to change it).

it would be great if there was an option where developer could decide if handleScroll is disabled then how crosshair should function… for my use case this was exactly what i wanted and so for my need i modified library code to get this functionality. i do not recommend anyone to use code in production. This is just for reference commit

i wanted to understand what problems were faced because of which above decision were made. As the comment stated in src/gui/pane-widget.ts

// actually we should check what event happened (touch or mouse) // not check current UA to detect “mobile” device const trackCrosshairOnlyAfterLongTap = isMobile;

if touch event were handled separately to the mouse click could it be easier to achieve above functionality ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Stop Crosshair From Moving in Valorant ... - YouTube
In this video we show you how to stop crosshair from moving in Valorant. The crosshair moves because of firing and movement error...
Read more >
tradingview/lightweight-charts v3.8.0 on GitHub
... Disabling scrolling by disabled horzTouchDrag and vertTouchDrag options disables moving crosshair in tracking mode (see #434); Reducing precision ...
Read more >
Interface: HandleScrollOptions | Lightweight Charts
Represents options for how the chart is scrolled by the mouse and touch ... Enable scrolling by holding down the left mouse button...
Read more >
Disable scrolling when touch moving certain element
Set the touch-action CSS property to none , which works even with passive event listeners: touch-action: none;. Applying this property to an ...
Read more >
Financial lightweight charts built with HTML5 canvas - JsRepos
... the price axis (see #939); Disabling scrolling by disabled horzTouchDrag and vertTouchDrag options disables moving crosshair in tracking mode (see #434) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found