visx icon indicating copy to clipboard operation
visx copied to clipboard

Brush interaction not working on mobile

Open BrianRosamilia opened this issue 4 years ago • 17 comments

(Enjoying the library, thanks for making it available)

I noticed the brush doesn't work with touch interactivity on mobile. Example here: https://vx-demo.now.sh/brush

After digging into the code a bit, I noticed that mobile events don't seem to be wired up for the Drag component. Shouldn't drag include touch and touchmove the same way as mouse and mousemove?

https://github.com/airbnb/visx/blob/master/packages/visx-drag/src/Drag.tsx#L121-L122

I could give it a shot if this is unintended and no one has time to look into it or is currently doing so. Lmk

BrianRosamilia avatar Oct 06 '20 02:10 BrianRosamilia

Hey @BrianRosamilia thanks for the bug report 🙏 I think this is simply an oversight with @visx/drag, it should support the touch events as you noted.

Would happily review a PR if you want to take a shot!

williaster avatar Oct 07 '20 18:10 williaster

@williaster

Can you (or someone) help me build the brush and its dependencies?

Interestingly, the build for the brush points at the lib folder of @visx/drag and not at drag directly, which I'm noticing almost no other components do--so the instructions for building/debugging a single component don't actually work, as I see it :( I can work on the brush by following the instructions, but when I try to modify drag it doesn't work.

https://github.com/airbnb/visx/blob/master/packages/visx-brush/src/BaseBrush.tsx#L4

Feel free to just show me a bash script to build brush & its dependencies properly, I'm guessing this has been solved before!

Edit: you can just use yarn build to avoid this but it builds all of the components

BrianRosamilia avatar Oct 09 '20 19:10 BrianRosamilia

@BrianRosamilia did you make any progress with this? also came here because I noticed that the brush is broken on mobile :/

edit: Sorry totally missed your pull request 🤦 ... anyway, is there a chance that this gets a review (and merge) soon?

m9dfukc avatar Oct 20 '20 15:10 m9dfukc

@williaster (quick FYI as I was perusing the open bugs again) - I believe this issue can be immediately closed, since #1155 was merged.

iampueroo avatar Jun 15 '21 16:06 iampueroo

Has this issue actually been fixed? I tried it on my mobile now (Android) and it isn't working.

shripadk avatar Jun 30 '21 05:06 shripadk

I just played with it on mobile/android also, the brush moves but it's not a smooth experience/you can't really get it to do what you want. so looks like there's maybe some more validation/improvements that need to be made for that case.

williaster avatar Jun 30 '21 17:06 williaster

Yep found a couple of refs that still have onMouse... in @visx/brush, should be a simple fix if anyone is interested!

e.g., https://github.com/airbnb/visx/blob/29068acb2afeb64df55a4c97085b1960fd409376/packages/visx-brush/src/BrushCorner.tsx#L163

williaster avatar Jun 30 '21 19:06 williaster

closed by #1286

williaster avatar Jul 21 '21 22:07 williaster

@williaster are you sure this is fixed? I tried on https://airbnb.io/visx/brush with my mobile device and it still seems to behave somewhat random.

sakulstra avatar Jul 25 '21 15:07 sakulstra

yeppp, still not working I agree 🤦

williaster avatar Jul 27 '21 21:07 williaster

Any progress?

Stuhl avatar Nov 23 '21 17:11 Stuhl

Would love to renew this issue.

It was an assumption of mine that this would work on mobile. Happy to put in some work if anyone knows the clear fix, or to spend some time identifying it.

RyKilleen avatar Jul 07 '23 18:07 RyKilleen

Given that everything is mobile-first nowadays, it's a pity this issue hasn't been addressed yet. Could this be prioritized, please?

rubo avatar Mar 28 '24 00:03 rubo