Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputAccessoryView stopped working with multiple Inputs using the same inputAccessoryViewID #47865

Open
LubomirGocnikTechmates opened this issue Nov 21, 2024 · 7 comments

Comments

@LubomirGocnikTechmates
Copy link

Description

After upgrading the project to Expo 52 I discovered, that the InputAccessoryView stopped working, if there are multiple TextInputs, that share the same inputAccessoryViewID.

For clarity, I reproduced the issue in the snack.expo.dev directly in the example on InputAccessoryView.

If you run the example with Expo 51 (react-native v0.74.5) everything works as expected, it doesn't matter, if I focus the first or the second TextInput.
But if I change the Expo version to 52 (react-native v0.76.2), the InputAccessoryView shows only after focusing the first TextInput.

At first I reported the issue in the expo repository expo/expo#33069 .
But it looks like the issue is in the react-native library

Steps to reproduce

  1. Open https://snack.expo.dev/LrCtZwQpPEm0SswYOmSQn
  2. In bottom right corner select Expo v52.0.0 and enable Preview
  3. In upper right corner select iOS
  4. When the app starts running click on the first input -> The InputAccessoryView is there
  5. then click on the second input -> The InputAccessoryView dissapears

If you repeat these steps but with the Expo v51.0.0 the InputAccessoryView is visiblle for both Inputs.

React Native Version

0.76.2

Affected Platforms

Runtime - iOS

Output of npx react-native info

.

Stacktrace or Logs

.

Reproducer

https://snack.expo.dev/LrCtZwQpPEm0SswYOmSQn

Screenshots and Videos

No response

@xryanmason
Copy link

xryanmason commented Nov 23, 2024

This doesn't solve the issue of sharing the same InputAccessoryView, but I was able to work around this for my use case.

I have a list of fields mapping out to the UI and I was able to use inputAccessoryViewID={inputAccessoryViewID + key} and nativeID={inputAccessoryViewID + key} to make a unique InputAccessoryView for each field.

@LubomirGocnikTechmates
Copy link
Author

Hello @xryanmason, thank you for confirming that this is really an issue and to provide a workaround.

I also created a similar workaround, but I think that the react-native team should either change the documentation, that the multiple inputs with the same ID aren't supported anymore, or, well fix that.

@TnRc
Copy link

TnRc commented Dec 9, 2024

Having the same issue. Any updates on this?

@razrabotal
Copy link

Any updates?

@keepersmith
Copy link

Same issue here.
+1

@alianza
Copy link

alianza commented Jan 15, 2025

Running into the same issue. Before this was working fine. I don't want to create unique inputAccessories for every input I have on a screen. This is not maintinable at all.

@jpangelle
Copy link

I am also having the same issue

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

No branches or pull requests

8 participants