Skip to content

Commit

Permalink
fix: race condition between keyboardWillHide and KVO
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed May 14, 2024
1 parent 02002e9 commit 4e3bb90
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ios/observers/FocusedInputObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,18 @@ public class FocusedInputObserver: NSObject {
let focusedInput = currentInput
let globalFrame = focusedInput?.globalFrame

guard let frame = globalFrame, let input = focusedInput else { return }

let data: [String: Any] = [
"target": responder.reactViewTag,
"parentScrollViewTarget": responder.parentScrollViewTarget,
"layout": [
"absoluteX": globalFrame?.origin.x,
"absoluteY": globalFrame?.origin.y,
"width": focusedInput?.frame.width,
"height": focusedInput?.frame.height,
"x": focusedInput?.frame.origin.x,
"y": focusedInput?.frame.origin.y,
"absoluteX": frame.origin.x,
"absoluteY": frame.origin.y,
"width": input.frame.width,
"height": input.frame.height,
"x": input.frame.origin.x,
"y": input.frame.origin.y,
],
]

Expand Down

0 comments on commit 4e3bb90

Please sign in to comment.