File tree 5 files changed +28
-2
lines changed
app/ui-tests-app/text-field
5 files changed +28
-2
lines changed Original file line number Diff line number Diff line change
1
+ import { TextField } from "tns-core-modules/ui/text-field" ;
2
+ import { TextView } from "tns-core-modules/ui/text-view" ;
3
+
4
+ export function onLoaded ( args ) {
5
+ const page = args . object ;
6
+ const textField = < TextField > page . getViewById ( "textField" ) ;
7
+ const textView = < TextView > page . getViewById ( "textView" ) ;
8
+
9
+ attachToEvent ( textField , "blur" ) ;
10
+ attachToEvent ( textField , "focus" ) ;
11
+ attachToEvent ( textView , "blur" ) ;
12
+ attachToEvent ( textView , "focus" ) ;
13
+ }
14
+
15
+ function attachToEvent ( control , event ) {
16
+ control . on ( event , ( ) => {
17
+ control . text = event + " is thrown" ;
18
+ } ) ;
19
+ }
Original file line number Diff line number Diff line change
1
+ <Page xmlns =" http://www.nativescript.org/tns.xsd" loaded =" onLoaded" >
2
+ <StackLayout >
3
+ <TextField id =" textField" />
4
+ <TextView id =" textView" />
5
+ </StackLayout >
6
+ </Page >
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export function loadExamples() {
14
14
examples . set ( "secured-text-field" , "text-field/secured-text-field-4135" ) ;
15
15
examples . set ( "max-length" , "text-field/max-length" ) ;
16
16
examples . set ( "text-field-border" , "text-field/text-field-border" ) ;
17
+ examples . set ( "focus-blur-events" , "text-field/focus-blur-events" ) ;
17
18
18
19
return examples ;
19
20
}
Original file line number Diff line number Diff line change 16
16
"tns-core-modules" : " *"
17
17
},
18
18
"devDependencies" : {
19
- "tns-platform-declarations" : " *" ,
20
19
"babel-traverse" : " 6.10.4" ,
21
20
"babel-types" : " 6.11.1" ,
22
21
"babylon" : " 6.8.3" ,
23
22
"lazy" : " 1.0.11" ,
24
23
"nativescript-dev-typescript" : " ^0.3.0" ,
24
+ "tns-platform-declarations" : " *" ,
25
25
"typescript" : " ~2.2.1"
26
26
}
27
27
}
Original file line number Diff line number Diff line change 16
16
"tns-core-modules" : " *"
17
17
},
18
18
"devDependencies" : {
19
- "tns-platform-declarations" : " *" ,
20
19
"babel-traverse" : " 6.9.0" ,
21
20
"babel-types" : " 6.9.0" ,
22
21
"babylon" : " 6.8.0" ,
23
22
"filewalker" : " 0.1.2" ,
24
23
"lazy" : " 1.0.11" ,
24
+ "tns-platform-declarations" : " *" ,
25
25
"typescript" : " ~2.2.1"
26
26
}
27
27
}
You can’t perform that action at this time.
0 commit comments