File tree Expand file tree Collapse file tree 4 files changed +10
-0
lines changed
packages/react-lightning/src Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @plexinc/react-lightning " : patch
3
+ ---
4
+
5
+ Added onFocusCapture event for better react native support
Original file line number Diff line number Diff line change @@ -214,6 +214,8 @@ export class LightningViewElement<
214
214
215
215
public on = this . _emitter . on . bind ( this . _emitter ) ;
216
216
public off = this . _emitter . off . bind ( this . _emitter ) ;
217
+ public addEventListener = this . _emitter . on . bind ( this . _emitter ) ;
218
+ public removeEventListener = this . _emitter . off . bind ( this . _emitter ) ;
217
219
public emit = this . _emitter . emit . bind ( this . _emitter ) ;
218
220
219
221
public constructor (
@@ -310,6 +312,7 @@ export class LightningViewElement<
310
312
311
313
public focus ( ) : void {
312
314
if ( ! this . _focused ) {
315
+ this . props . onFocusCapture ?.( this ) ;
313
316
this . _focused = true ;
314
317
this . _emitter . emit ( 'focusChanged' , true ) ;
315
318
this . props . onFocus ?.( this ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export interface Focusable {
8
8
}
9
9
10
10
export interface FocusableProps {
11
+ onFocusCapture ?: ( element : LightningElement ) => void ;
11
12
onFocus ?: ( element : LightningElement ) => void ;
12
13
onBlur ?: ( element : LightningElement ) => void ;
13
14
}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export interface LightningElementEvents {
13
13
destroy : ( ) => void ;
14
14
childAdded : ( child : LightningElement , index : number ) => void ;
15
15
childRemoved : ( child : LightningElement , index : number ) => void ;
16
+ childFocused : ( child : LightningElement ) => void ;
16
17
beforeRender : ( ) => void ;
17
18
layout : ( dimensions : Rect ) => void ;
18
19
textureLoaded : NodeLoadedEventHandler ;
You can’t perform that action at this time.
0 commit comments