visx
visx copied to clipboard
Brush interaction not working on mobile
(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
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
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 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?
@williaster (quick FYI as I was perusing the open bugs again) - I believe this issue can be immediately closed, since #1155 was merged.
Has this issue actually been fixed? I tried it on my mobile now (Android) and it isn't working.
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.
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
closed by #1286
@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.
yeppp, still not working I agree 🤦
Any progress?
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.
Given that everything is mobile-first nowadays, it's a pity this issue hasn't been addressed yet. Could this be prioritized, please?