Skip to content

focusDidSet is not called when TextInput has showSoftInputOnFocus={false} #758

Closed
@KingDoxik

Description

@KingDoxik

Describe the bug
focusDidSet is not called when TextInput has showSoftInputOnFocus={false}. There is probably a deeper problem with showSoftInputOnFocus. I started investigating this, because I want to show custom keyboard in an app for some TextInputs and I want to add KeyboardController.setFocusTo("next") - which is not working with showSoftInputOnFocus={false}. This problem stems from onFocusDidSet being called from keyboardWillShow. I am not sure if there is a better solution, but this is what I was able to figure out without knowing iOS dev.

Code snippet
<TextInput
onFocus={handleFocus}
onBlur={handleBlur}
className="p-3 bg-zinc-800 text-white rounded-xl"
showSoftInputOnFocus={false}
{...props}
/>

Repo for reproducing
It should be reproducible in any repo by adding showSoftInputOnFocus={false} to react-native TextInput

To Reproduce
add showSoftInputOnFocus={false} to TextInput

Expected behavior
Focus change should be registered even if keyboard is not showed.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone:

  • Desktop OS: MacOS 14.5
  • Device: iPhone 15 Pro
  • OS: iOS 18.1.1
  • RN version: 0.74.1
  • RN architecture: both new and old
  • JS engine: expo default
  • Library version: 1.15.2

Metadata

Metadata

Assignees

Labels

focused input 📝Anything about focused input functionalitysponsor 💖Someone pays money for the issue to be resolved 💸🍎 iOSiOS specific

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions