Skip to content

Commit 301d951

Browse files
authored
[web] Fix NativeViewGestureHandler style. (#3070)
## Description #3041 introduced a regression - calling `updateGestureConfig` resulted in `NativeViewGestureHandler` having `touchAction: none;` even though it shouldn't. Because of that our example app didn't scroll. ## Test plan Check that example app is scrolling.
1 parent b5c3aea commit 301d951

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/web/handlers/NativeViewGestureHandler.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ export default class NativeViewGestureHandler extends GestureHandler {
2727

2828
const view = this.delegate.getView() as HTMLElement;
2929

30-
view.style['touchAction'] = 'auto';
31-
// @ts-ignore Turns on defualt touch behavior on Safari
32-
view.style['WebkitTouchCallout'] = 'auto';
33-
30+
this.restoreViewStyles(view);
3431
this.buttonRole = view.getAttribute('role') === 'button';
3532
}
3633

@@ -43,6 +40,19 @@ export default class NativeViewGestureHandler extends GestureHandler {
4340
if (this.config.disallowInterruption !== undefined) {
4441
this.disallowInterruption = this.config.disallowInterruption;
4542
}
43+
44+
const view = this.delegate.getView() as HTMLElement;
45+
this.restoreViewStyles(view);
46+
}
47+
48+
private restoreViewStyles(view: HTMLElement) {
49+
if (!view) {
50+
return;
51+
}
52+
53+
view.style['touchAction'] = 'auto';
54+
// @ts-ignore Turns on defualt touch behavior on Safari
55+
view.style['WebkitTouchCallout'] = 'auto';
4656
}
4757

4858
protected resetConfig(): void {

0 commit comments

Comments
 (0)