File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,13 @@ class ViewWithElevationAndRipple extends View {
154
154
}
155
155
}
156
156
}
157
+ public requestFocus ( ) {
158
+ this . focus ( ) ;
159
+ }
160
+ public clearFocus ( ) {
161
+ handleClearFocus ( this . nativeViewProtected ) ;
162
+ ad . dismissSoftInput ( this . nativeViewProtected ) ;
163
+ }
157
164
158
165
getDefaultElevation ( ) : number {
159
166
const result = this instanceof Button ? 2 : 0 ;
Original file line number Diff line number Diff line change 1
1
import { Color } from '@nativescript/core' ;
2
2
3
+ declare module '@nativescript/core/ui/core/view' {
4
+ interface View {
5
+ clearFocus ( ) ;
6
+ requestFocus ( ) ;
7
+ }
8
+ }
9
+
3
10
export interface TypographyOptions {
4
11
fontFamily ?: string ;
5
12
fontSize ?: number ;
Original file line number Diff line number Diff line change @@ -106,9 +106,7 @@ export class Themer {
106
106
107
107
export const themer = new Themer ( ) ;
108
108
109
- export function install ( ) {
110
-
111
- }
109
+ export function install ( ) { }
112
110
113
111
export function getRippleColor ( color : string | Color ) : UIColor {
114
112
if ( color ) {
@@ -190,6 +188,13 @@ class ViewWithElevationAndRipple extends View {
190
188
this . shadowLayer . elevation = elevation ;
191
189
}
192
190
}
191
+
192
+ public requestFocus ( ) {
193
+ this . focus ( ) ;
194
+ }
195
+ public clearFocus ( ) {
196
+ this . nativeViewProtected . resignFirstResponder ( ) ;
197
+ }
193
198
[ rippleColorProperty . setNative ] ( color : Color ) {
194
199
this . getOrCreateRippleController ( ) ;
195
200
this . inkTouchController . rippleView . rippleColor = getRippleColor ( color ) ;
You can’t perform that action at this time.
0 commit comments