Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ios/observers/FocusedInputObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ public class FocusedInputObserver: NSObject {
setupObservers()
// dispatch onSelectionChange on focus
if let textInput = responder as? UITextInput {
updateSelectionPosition(textInput: textInput, sendEvent: onSelectionChange)
DispatchQueue.main.async {
updateSelectionPosition(textInput: textInput, sendEvent: self.onSelectionChange)
}
}

syncUpLayout()
Expand Down
5 changes: 5 additions & 0 deletions src/components/KeyboardAwareScrollView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ const KeyboardAwareScrollView = forwardRef<

lastSelection.value = e;

// pre iOS 16 case, when selection event delivered between `onStart` and `onMove` events
if (keyboardWillAppear.value) {
updateLayoutFromSelection();
}

if (e.target !== lastTarget) {
// ignore this event, because "focus changed" event handled in `useSmoothKeyboardHandler`
return;
Expand Down
Loading