Skip to content

Commit 22df7cf

Browse files
committed
fix: exclusiveTouch css prop
1 parent 76091d6 commit 22df7cf

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/gesturehandler.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ let installedOverrides = false;
5050
export function install(overrideNGestures = false) {
5151
if (!installed) {
5252
installed = true;
53-
installBase();
53+
installBase(overrideNGestures);
5454
const NSPage = require('@nativescript/core/ui/page').Page;
5555
NSPage.prototype.createNativeView = function () {
5656
if (!PageLayout) {

src/gesturehandler.common.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import Observable from '@nativescript-community/observable';
77
import { EventData } from '@nativescript/core';
8-
import { Property, View, booleanConverter } from '@nativescript/core/ui';
8+
import { CssProperty, Property, Style, View, booleanConverter } from '@nativescript/core/ui';
99
import {
1010
FlingGestureHandler,
1111
FlingGestureHandlerOptions,
@@ -255,11 +255,6 @@ export const ViewInitEvent = 'ViewInitEvent';
255255
export const ViewDisposeEvent = 'ViewDisposeEvent';
256256

257257
let NATIVE_GESTURE_TAG = 74000;
258-
export const exclusiveTouchProperty = new Property<View, boolean>({
259-
name: 'exclusiveTouch',
260-
defaultValue: false,
261-
valueConverter: booleanConverter,
262-
});
263258
class ViewGestureExtended extends View {
264259
exclusiveTouchGestureHandler: NativeViewGestureHandler;
265260
initNativeView() {
@@ -292,14 +287,21 @@ class ViewGestureExtended extends View {
292287
}
293288
}
294289

290+
export const exclusiveTouchProperty = new CssProperty<Style, boolean>({
291+
name: 'exclusiveTouch',
292+
cssName: 'exclusive-touch',
293+
defaultValue: false,
294+
valueConverter: booleanConverter,
295+
});
296+
exclusiveTouchProperty.register(Style);
297+
295298
let installed = false;
296299
export function overrideViewBase() {
297300
const NSView = require('@nativescript/core/ui/core/view').View;
298-
exclusiveTouchProperty.register(NSView);
299301
applyMixins(NSView, [ViewGestureExtended]);
300302
}
301303

302-
export function install() {
304+
export function install(overrideNGestures?: boolean) {
303305
if (installed) {
304306
return;
305307
}

src/gesturehandler.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ let installedOverrides = false;
3333
export function install(overrideNGestures = false) {
3434
if (!installed) {
3535
installed = true;
36-
installBase();
36+
installBase(overrideNGestures);
3737
}
3838

3939
if (overrideNGestures === true && !installedOverrides) {

0 commit comments

Comments
 (0)