React-vis: Touch support for Highlight

Created on 6 Feb 2019  路  4Comments  路  Source: uber/react-vis

When using highlight with touch devices you cannot drag or brush.

Today using the device emulator in Chrome, the touch events just navigates around the page:

9sugx9vd0p

I started prototyping this feature registering onTouchMove event listener instead of using the onTouchMove property of the rect element. This event listener is registered as an "active" event listener (https://developers.google.com/web/updates/2017/01/scrolling-intervention) so that preventDefault is available when the component is brushing or dragging.

With "native" event listener
lszpi00ldi

Taking this approach any movement in the chart will be "prevented" and interpreted as a brush/drag.
And might impact overall performance on the page when this listener is active.

I just wanted to check if there is any interest in making this change in the core library or if I should continue the work in a fork.

Most helpful comment

I would like this feature.

All 4 comments

I would like this feature.

I like this feature.

I would really appreciate this feature, because we need to implement this functionality! Is there any progress for this?

I have fixed touch event support for brushing in my fork https://github.com/rlaffers/react-vis/tree/touch-events-brushing
This is based off the 1.11.7 release, so I can't PR this into master. Maybe I will find time to port those changes into master with its new workspaces structure - but feel free to do it yourself.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tom-Gorup picture Tom-Gorup  路  3Comments

mcnuttandrew picture mcnuttandrew  路  5Comments

martoncsikos picture martoncsikos  路  4Comments

basilaiman picture basilaiman  路  3Comments

wroughtec picture wroughtec  路  4Comments