Skip to content

Commit 7a78ef3

Browse files
authored
fix: do not set touch-action: none on dashboard to allow scroll (#10033)
1 parent 7a634a6 commit 7a78ef3

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

packages/dashboard/src/styles/vaadin-dashboard-widget-base-styles.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const widgetStyles = css`
5656
inset-inline-end: 0;
5757
z-index: 1;
5858
overflow: hidden;
59+
touch-action: none;
5960
cursor: nwse-resize;
6061
--icon: var(--_vaadin-icon-resize);
6162
}

packages/dashboard/src/widget-resize-controller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* See https://vaadin.com/commercial-license-and-service-terms for the full
99
* license.
1010
*/
11-
import { addListener } from '@vaadin/component-base/src/gestures.js';
11+
import { addListener, setTouchAction } from '@vaadin/component-base/src/gestures.js';
1212
import { getElementItem, itemsEqual, WRAPPER_LOCAL_NAME } from './vaadin-dashboard-helpers.js';
1313

1414
/**
@@ -20,6 +20,8 @@ export class WidgetResizeController {
2020
this.__resizedElementRemoveObserver = new MutationObserver(() => this.__restoreResizedElement());
2121
this.__touchMoveCancelListener = (e) => e.preventDefault();
2222
addListener(host, 'track', (e) => this.__onTrack(e));
23+
// Do not set touch-action: none to allow scroll on mobile
24+
setTouchAction(host, '');
2325
host.addEventListener('item-resize', (e) => this.__itemResize(e));
2426
}
2527

packages/dashboard/test/dom/__snapshots__/dashboard.test.snap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
export const snapshots = {};
33

44
snapshots["vaadin-dashboard host"] =
5-
`<vaadin-dashboard style="touch-action: none;">
5+
`<vaadin-dashboard style="">
66
<vaadin-dashboard-widget-wrapper
77
slot="slot-0"
88
style=""

packages/vaadin-lumo-styles/src/components/dashboard-widget.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
bottom: calc(-1 * var(--_resize-button-offset));
121121
inset-inline-end: calc(-1 * var(--_resize-button-offset));
122122
cursor: nwse-resize;
123+
touch-action: none;
123124
--icon: var(--lumo-icons-resize-handle);
124125
}
125126

0 commit comments

Comments
 (0)