Skip to content

Commit 723a14b

Browse files
committed
fixes swipe on view
1 parent a91062c commit 723a14b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/fab-common.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*************************************************************************************/
77
import { Color } from 'tns-core-modules/color';
88
import { Property, View } from 'tns-core-modules/ui/core/view';
9-
import { topmost } from 'tns-core-modules/ui/frame';
109
import { PanGestureEventData } from 'tns-core-modules/ui/gestures';
1110
import * as definitions from './index';
1211

@@ -23,13 +22,20 @@ export class FloatingActionButtonBase extends View implements definitions.Fab {
2322
public rippleColor: Color;
2423
public icon: string;
2524

26-
onLa;
2725
onLoaded() {
2826
super.onLoaded();
27+
2928
if (this.swipeEventAttached === false) {
3029
const fab = this;
3130
if (this.hideOnSwipeOfView) {
32-
const swipeItem = topmost().getViewById(this.hideOnSwipeOfView);
31+
const parent = this.parent || this.parentNode;
32+
const swipeItem = parent.getViewById(this.hideOnSwipeOfView);
33+
34+
// check if we have the UI to attach animation to
35+
if (!swipeItem) {
36+
return;
37+
}
38+
3339
const animationType = this.swipeAnimation
3440
? this.swipeAnimation
3541
: 'slideDown';

src/platforms/android/include.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
//default elements
22
android {
3-
productFlavors {
4-
"nativescriptfloatingactionbutton" {
5-
dimension "nativescriptfloatingactionbutton"
6-
}
7-
}
3+
84
}
95

106
allprojects {

0 commit comments

Comments
 (0)