Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScrollView - The scrolling operation is interrupted on touch devices (T886654) #12917

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/ui/overlay/ui.overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ const Overlay = Widget.inherit({
const originalEvent = e.originalEvent.originalEvent;
e._cancelPreventDefault = true;

if(originalEvent && originalEvent.type !== 'mousemove') {
if(originalEvent && originalEvent.type !== 'mousemove' && e.cancelable !== false) {
e.preventDefault();
}
});
Expand Down
43 changes: 43 additions & 0 deletions testing/tests/DevExpress.ui.widgets/overlay.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3554,6 +3554,49 @@ testModule('scrollable interaction', {
.off('.TEST');
});

// T886654
test('Scroll event should not prevented on overlay that avoid the [Intervation] error when event is not cancelable', function(assert) {
assert.expect(1);

const $overlay = $($('#overlay').dxOverlay());
const $scrollable = $('<div>');

$overlay.dxOverlay('instance').option('visible', true);
const $content = $($overlay.dxOverlay('$content')).append($scrollable);

$scrollable.dxScrollable({
useNative: true,
bounceEnabled: false,
direction: 'vertical',
inertiaEnabled: false
});

const $overlayWrapper = $content.closest(toSelector(OVERLAY_WRAPPER_CLASS));

$($overlayWrapper).on('dxdrag', {
getDirection: () => 'both',
validate: () => true
}, (e) => {
assert.strictEqual(e.isDefaultPrevented(), false, 'not cancelable event should not be prevented');
});

$($overlayWrapper.parent()).on('dxdrag', {
getDirection: function() { return 'both'; },
validate: function() { return true; }
}, function() {
assert.ok(false, 'event should not be fired');
});

const event = $.Event('dxdrag', {
cancelable: false,
originalEvent: $.Event('dxpointermove', {
originalEvent: $.Event('touchmove')
})
});

$($overlayWrapper).trigger(event);
});

test('scroll event does not prevent gestures', function(assert) {
const $gestureCover = $('.dx-gesture-cover');
const originalPointerEvents = $gestureCover.css('pointerEvents');
Expand Down