Some time ago I experienced a problem where scrolling on touch devices didn't work anymore when my ExtJS 5 App was embedded in an IFrame (see this thread).
I've solved this by overriding some stuff from the Ext framework (see the solution).
One step of the solution was to dispatch a touchmove
event to the document itself (the framework prevents default handling of this event):
// ...
touchmove: function(e) {
window.document.dispatchEvent(e.event);
}
// ...
Even though this solution basically works it has one flaw:
Dispatching the event throws an unhandled InvalidStateError
on every touchmove
event which is obviously quite often:
If I simply put a try/catch around the dispatchEvent
statement, scrolling inside the IFrame on touch devices doesn't work anymore as if not calling it at all.
How can I get rid of the error without breaking scrolling again?
Testapp where scrolling works but many unhandled errors occur can be tested here.