Open sgardn opened 4 years ago
Defo would be useful :) although to be fair, you can just add the style on the CanvasDraw component :smile:
style={{ touchAction: disabled ? 'auto' : 'none' }}
where disabled
is your state for whether you are disabling drawing or not
Hi there. I'm using the canvas component for a game I'm creating, and I find myself unable to scroll past the canvas while on mobile because of the css property
touch-action: 'none';
set on the wrapperdiv
for the canvases. Basically, whether or not the canvas is disabled, all touch events fail to allow scroll. What I've done locally is conditionalize it like so:I think that scrolling behavior should probably be enabled if the canvas isn't "paintable", since there's nothing else you'd intend to do to a disabled canvas. I'm happy to open a PR with the tiny change, seems like a use case other people will eventually bump into if they use it on mobile.
Thanks for making something cool!