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 {
154154 }
155155 }
156156 }
157+ public requestFocus ( ) {
158+ this . focus ( ) ;
159+ }
160+ public clearFocus ( ) {
161+ handleClearFocus ( this . nativeViewProtected ) ;
162+ ad . dismissSoftInput ( this . nativeViewProtected ) ;
163+ }
157164
158165 getDefaultElevation ( ) : number {
159166 const result = this instanceof Button ? 2 : 0 ;
Original file line number Diff line number Diff line change 11import { Color } from '@nativescript/core' ;
22
3+ declare module '@nativescript/core/ui/core/view' {
4+ interface View {
5+ clearFocus ( ) ;
6+ requestFocus ( ) ;
7+ }
8+ }
9+
310export interface TypographyOptions {
411 fontFamily ?: string ;
512 fontSize ?: number ;
Original file line number Diff line number Diff line change @@ -106,9 +106,7 @@ export class Themer {
106106
107107export const themer = new Themer ( ) ;
108108
109- export function install ( ) {
110-
111- }
109+ export function install ( ) { }
112110
113111export function getRippleColor ( color : string | Color ) : UIColor {
114112 if ( color ) {
@@ -190,6 +188,13 @@ class ViewWithElevationAndRipple extends View {
190188 this . shadowLayer . elevation = elevation ;
191189 }
192190 }
191+
192+ public requestFocus ( ) {
193+ this . focus ( ) ;
194+ }
195+ public clearFocus ( ) {
196+ this . nativeViewProtected . resignFirstResponder ( ) ;
197+ }
193198 [ rippleColorProperty . setNative ] ( color : Color ) {
194199 this . getOrCreateRippleController ( ) ;
195200 this . inkTouchController . rippleView . rippleColor = getRippleColor ( color ) ;
You can’t perform that action at this time.
0 commit comments