Skip to content

Commit

Permalink
fix: tv remote handler longPress event & onBlur/onFocus events
Browse files Browse the repository at this point in the history
  • Loading branch information
aurimasmi committed Sep 22, 2023
1 parent 863127c commit 85111f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/create/ios/TvRemoteHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ class TvRemoteHandler: RCTEventEmitter, UIGestureRecognizerDelegate {
timer.invalidate()
return
}
self.sendAppleTVEvent(eventType: direction!, eventKeyAction: "down", velocity: 0.0)
self.sendAppleTVEvent(eventType: direction!, eventKeyAction: "longPress", velocity: 0.0)
timer.invalidate()
}

} else if gesture.state == .ended || gesture.state == .cancelled {
Expand Down
4 changes: 2 additions & 2 deletions packages/create/src/focusManager/service/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class CoreManager {

const nextForcedFocusKey = this.getNextForcedFocusKey(parent, direction);
if (nextForcedFocusKey) {
if (findFocusInParent) {
if (findFocusInParent && closestView.getParent()?.getType() !== MODEL_TYPES.SCREEN) {
currentFocus.getParent()?.onBlur();
closestView.getParent()?.onFocus();
}
Expand All @@ -232,7 +232,7 @@ class CoreManager {
return currentFocus;
}

if (findFocusInParent) {
if (findFocusInParent && closestView.getParent()?.getType() !== MODEL_TYPES.SCREEN) {
currentFocus.getParent()?.onBlur();
closestView.getParent()?.onFocus();
}
Expand Down

0 comments on commit 85111f3

Please sign in to comment.