I can't move website created in famous on mobile device

89 Views Asked by At

I've created website completely in angular + famous.

In desktop it's working great. When I try to open it in safari / chrome on iPhone it's working great as well but there is one problem. Using my finger I can't move page at all, only touch event is recognized, nothing more.

This is happening also in official examples. For example examples/views/Scrollview/example.html. If I rotate my iPhone 6 Plus to landscape I can't even access the browser toolbar to close the page, I need to kill the browser and start it again.

What I am suppose to do to fix this? Why is this even happening?

2

There are 2 best solutions below

0
On

The problem is that you are using Famous in appMode. Try setting the following and see if that works:

Engine.setOptions({appMode: false});

When Famous is in appMode, it will add the following snippet when the context is created:

function initialize() {
    // prevent scrolling via browser
    window.addEventListener('touchmove', function(event) {
        event.preventDefault();
    }, true);

    addRootClasses();
}

This is what prevents the browser page from moving.

2
On
function initialize() { 
  // prevent scrolling via browser 
  window.addEventListener('touchmove', function(event) {     
    event.preventDefault(); 
  }, true); 
  addRootClasses(); 
}