nativescript-community / nativescript-community/gesturehandler

Gesture handler not working with ui-chart on ios

Open
#18 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
15
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Summary
I am using @nativescript-cummunity/ui-chart to display a line chart in my application, it seems to work out in android seamlessly, for IOS though, I have to refresh my screen twice for my chart to be visible and once it appears I am not able to tap or drag on the chart.

This is the error I keep seeing :
NS error log:{"type":"JavaScript","message":"this.manager.registerGestureHandler is not a function","stack":"TypeError: this.manager.registerGestureHandler is not a function\n at Manager.attachGestureHandler (file:///app/vendor.js:6169:22)\n at TapHandler.attachToView (file:///app/vendor.js:5971:28)\n at BarLineChartTouchListener.setTap (file:///app/vendor.js:17827:49)\n at LineChart.setHighlightPerTapEnabled (file:///app/vendor.js:11637:48)\n at ChartsComponent.createLineChart (file:///app/bundle.js:2209:22)\n at ChartsComponent.onLineChartLoaded (file:///app/bundle.js:2148:14)\n at ChartsComponent__chart_LineChart_3_Template__chart_LineChart_loaded_0_listener (file:///app/bundle.js:1993:386)\n at executeListenerWithErrorHandling (file:///app/vendor.js:139587:12)\n at Object.wrapListenerIn_markDirtyAndPreventDefault (file:///app/vendor.js:139618:18)\n at _ZoneDelegate.invokeTask (file:///app/vendor.js:103604:31)"}

P.S
this is only an issue with GestureHandler version > 2.0.12, I have 2 repos, it seems to work where my GestureHandler version is 2.0.12, it does not work for the second repo where version is 2.0.24/2.0.28. This version is controlled by ui-chart automatically.

Also, if I remove the below lines which are essentially calling for gesture handler, the issue goes away but then I don't have the functionality for tap or drag:
this.lineRef.setHighlightPerTapEnabled(true);
this.lineRef.setHighlightPerDragEnabled(true);

Expected Behaviour:

Chart should be visible at all times and gestures should be enabled.

Device (please complete the following information):

Device: Iphone 15 pro, pro max, iphone 13
Ios version : 17.0.2, 15.0.0
Library Version :

ui-chart : 1.2.28/1.2.32/1.2.35
gestureHandler: 2.0.24/2.0.28

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack trace around Manager.attachGestureHandler, TapHandler.attachToView, and LineChart.setHighlightPerTapEnabled, then compare behavior with gestureHandler 2.0.12 versus 2.0.24/2.0.28 and ui-chart 1.2.28/1.2.32/1.2.35. Reproduce on the listed iOS devices and confirm that the chart renders and tap/drag gestures work without requiring refreshes.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.