File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
packages/react-native-web/src/exports Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,9 @@ const TouchableHighlight = ((createReactClass({
329
329
330
330
render : function ( ) {
331
331
const child = React . Children . only ( this . props . children ) ;
332
+ // Add this event listeners only for TVs
333
+ const onBlur = Platform . isTV ? { onBlur : this . touchableHandleBlur } : { } ;
334
+ const onFocus = Platform . isTV ? { onFocus : this . touchableHandleFocus } : { } ;
332
335
return (
333
336
< View
334
337
{ ...this . props }
@@ -342,8 +345,8 @@ const TouchableHighlight = ((createReactClass({
342
345
nativeID = { this . props . nativeID }
343
346
//isTVSelectable={true}
344
347
//tvParallaxProperties={this.props.tvParallaxProperties}
345
- onBlur = { this . touchableHandleBlur }
346
- onFocus = { this . touchableHandleFocus }
348
+ { ... onBlur }
349
+ { ... onFocus }
347
350
onKeyDown = { this . touchableHandleKeyEvent }
348
351
//nextFocusDown={this.props.nextFocusDown}
349
352
//nextFocusForward={this.props.nextFocusForward}
Original file line number Diff line number Diff line change @@ -282,6 +282,9 @@ const TouchableOpacity = ((createReactClass({
282
282
} ,
283
283
284
284
render : function ( ) {
285
+ // Add this event listeners only for TVs
286
+ const onBlur = Platform . isTV ? { onBlur : this . touchableHandleBlur } : { } ;
287
+ const onFocus = Platform . isTV ? { onFocus : this . touchableHandleFocus } : { } ;
285
288
return (
286
289
< View
287
290
{ ...this . props }
@@ -293,8 +296,8 @@ const TouchableOpacity = ((createReactClass({
293
296
hasTVPreferredFocus = { this . props . hasTVPreferredFocus }
294
297
hitSlop = { this . props . hitSlop }
295
298
nativeID = { this . props . nativeID }
296
- onBlur = { this . touchableHandleBlur }
297
- onFocus = { this . touchableHandleFocus }
299
+ { ... onBlur }
300
+ { ... onFocus }
298
301
onKeyDown = { this . touchableHandleKeyEvent }
299
302
//isTVSelectable={true}
300
303
//nextFocusDown={this.props.nextFocusDown}
You can’t perform that action at this time.
0 commit comments