arrowman
arrowman

Reputation: 426

Canvas (fabricjs) block web browser zooming and moving on mobiles

In mobile version of web browser (android default, firefox, safari, chorome etc.)

I don't know why I can't move screen when I touch canvas area.

The problem is also with zooming. If I start zoom outside the canvas and continue oferr the canvas it is ok. But when I start zooming browser window on canvas it doesn't work.

Does someone know this problem?

Oh, I forget... Simple example:

`http://jsfiddle.net/arrowman/cts831tg/3/`

Upvotes: 1

Views: 2115

Answers (2)

domdambrogia
domdambrogia

Reputation: 2243

allowTouchScrolling: true is the setting you're after.

This should be initialized when you create your canvas within the arguments in the second parameter.

var canvas = new fabric.Canvas('your-canvas-id', {
    backgroundColor : '#000',
    height: 400,
    width: 400,
    allowTouchScrolling: true, // <-- this is what you're after
});

Upvotes: 2

arrowman
arrowman

Reputation: 426

I found solution. It is:

canvas.allowTouchScrolling = true;

Bests,
A.

Upvotes: 1

Related Questions