Skip to content

After setting the inputAccessoryViewID for TextInput, listening to keyboardDidShow will trigger repeatedly #54542

Closed as not planned

Description

@Jackie-Tang

Description

In iOS, after setting the inputAccessoryViewID for TextInput, you can listen to keyboardDidShow. Every time a value is entered, keyboardDidShow will be triggered

Steps to reproduce

useEffect(() => {
const showSubscription = Keyboard.addListener('keyboardDidShow', () => {
xxRef.current++;
setShowNum(xxRef.current);
setKeyboardStatus('Keyboard Shown');
});
const hideSubscription = Keyboard.addListener('keyboardDidHide', () => {
setKeyboardStatus('Keyboard Hidden');
});

return () => {
showSubscription.remove();
hideSubscription.remove();
};
}, []);
<TextInput
placeholder="Click here…"
inputAccessoryViewID="inputAccessory2"
style={style.input}
value={input2}
onChangeText={value => {
setInput2(value);
}}
/>

React Native Version

0.82.1

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.6.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 129.45 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.11.1
    path: /Users/jackie/.nvm/versions/node/v20.11.1/bin/node
  Yarn:
    version: 1.22.21
    path: /Users/jackie/.nvm/versions/node/v20.11.1/bin/yarn
  npm:
    version: 10.2.4
    path: /Users/jackie/.nvm/versions/node/v20.11.1/bin/npm
  Watchman:
    version: 2025.08.11.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.4
      - iOS 18.4
      - macOS 15.4
      - tvOS 18.4
      - visionOS 2.4
      - watchOS 11.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.3 AI-233.14808.21.2331.11842104
  Xcode:
    version: 16.3/16E140
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 24.0.2
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/jackie/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.77.1
    wanted: 0.77.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

null

MANDATORY Reproducer

https://snack.expo.dev/@jackie_tang/blessed-yellow-ramen

Screenshots and Videos

No response

Activity

  1. IslamRustamov commented on Nov 15, 2025

    @IslamRustamov
    Contributor

    This is happening because in updateProps (in RCTTextInputComponentView) there is setDefaultInputAccessoryView being called.

    Basically every time TextInput checks for new props - setDefaultInputAccessoryView is called and that is calling reloadInputViews, which is causing "refocus" of the input.

    Not sure how to fix it for now.

    upd: tried to implement a fix #54551 - it's working but I'm not sure if it's an ideal solution

  2. Thotaharshavardhani commented on Nov 16, 2025

    @Thotaharshavardhani

    Hello, I could reproduce this error using the snack reproducer that you mentioned.

  3. react-native-bot commented on Jun 8, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  4. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Jun 8, 2026
  5. react-native-bot commented on Jun 16, 2026

    @react-native-bot
    Collaborator

    This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions