fix(h5): reduce report swipe conflicts and limit edge overscroll
This commit is contained in:
+6
-1
@@ -1513,12 +1513,17 @@
|
||||
panels[i].setAttribute('role', 'tabpanel'); panels[i].setAttribute('aria-labelledby', tab.id);
|
||||
});
|
||||
function height(at) {
|
||||
// Fonts/images may resize while dragging. Keep the current card height
|
||||
// until release so the rest of the report does not move under the finger.
|
||||
if (swipe && swipe.isDragging()) return;
|
||||
position = at;
|
||||
var lower = Math.floor(at), upper = Math.min(panels.length - 1, Math.ceil(at)), ratio = at - lower;
|
||||
viewport.style.height = (panels[lower].offsetHeight * (1 - ratio) + panels[upper].offsetHeight * ratio) + 'px';
|
||||
}
|
||||
var swipe = SwipeTrack.create(viewport, track, { count: panels.length, gestureTarget: card,
|
||||
onMove: height, onCancel: height, onSelect: function (i) { setDetailTab(card, String(i)); } });
|
||||
gestureSelector: '.viz-frame', startThreshold: 12, directionRatio: 1.5, maxOverscroll: 16,
|
||||
onStart: function () { viewport.style.height = viewport.getBoundingClientRect().height + 'px'; },
|
||||
onCancel: height, onSelect: function (i) { setDetailTab(card, String(i)); } });
|
||||
detailSwipes.set(card, { swipe: swipe, height: height });
|
||||
setDetailTab(card, '0', true);
|
||||
if (typeof ResizeObserver !== 'undefined') {
|
||||
|
||||
Reference in New Issue
Block a user