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

App freezes when focus TextInput #26707

Closed
perlo27 opened this issue Oct 3, 2019 · 33 comments
Closed

App freezes when focus TextInput #26707

perlo27 opened this issue Oct 3, 2019 · 33 comments
Labels
Bug Component: TextInput Related to the TextInput component. Resolution: Locked This issue was locked by the bot.

Comments

@perlo27
Copy link

perlo27 commented Oct 3, 2019

React Native version:
0.61.1

Steps To Reproduce

  1. npx react-native init test-textinput
  2. add TextInput component
const App = () => {
  const [value, setValue] = useState('init');
  return (
    <View style={{ flex: 1, marginTop: 100 }}>
       <TextInput value={value} onChangeText={text => setValue(text)} />
    </View>
  );
};
  1. Open app in Iphone8 emulator

Describe what you expected to happen:
it is possible to type text into input field

What actually happens:
Application freezes after focusing TextInput

@perlo27 perlo27 added the Bug label Oct 3, 2019
@react-native-bot react-native-bot added the Component: TextInput Related to the TextInput component. label Oct 3, 2019
@richardfelkl
Copy link

I experience the same issue with RN 0.61.2 as well. It works on Android but every focus to TextInput on iOS freezes the app.

@Looveh
Copy link

Looveh commented Oct 4, 2019

I experience the same issue on an iOS13 iPhone 11 Pro simulator using RN 0.59.9

@Annihil
Copy link

Annihil commented Oct 4, 2019

I can confirm also having this with RN 0.61.2 in Release mode on iOS 13

@m4rcoperuano
Copy link

Same thing here :(. iPhone 8 simulator.

@Shooksie
Copy link

Shooksie commented Oct 5, 2019

It's happening to me In Development, it seems to only impact ios13. I downloaded an ios12.2 simulator and there are no issues but when I try an ios13 simulator the whole app will freeze the moment I focus on any text input.

@mmmulani
Copy link
Contributor

mmmulani commented Oct 6, 2019

could you provide a stack frame of the app by doing:

open Activity Monitor on your Mac, sort by CPU usage. Your app should be at the top (it runs as a process on your Mac even though it's in an iPhone/iPad), hit the Info button and then click Sample in the bottom left. Then paste that stackframe here as a Gist. It should help us narrow down where the issue is coming from.

@swizes
Copy link

swizes commented Oct 6, 2019

same problem occurs on iPhone X 13.0 simulator. The app is installed and launched via react-native run-ios

@ozgursoy
Copy link

ozgursoy commented Oct 6, 2019

Same problem here

RN 0.61.2 
iOS 13 
iPhone 11 Simulator

@mmmulani
Copy link
Contributor

mmmulani commented Oct 6, 2019

please stop commenting if you have the same problem as it isn't really helpful. Instead provide a stack frame as per my instructions here: #26707 (comment)

@ozgursoy
Copy link

ozgursoy commented Oct 6, 2019

@mmmulani
Copy link
Contributor

mmmulani commented Oct 7, 2019

@Farad4y thanks a lot for that!

it looks like the main thread is trying to read from the pasteboard and locking up. I expect this is a Simulator only issue that probably happens when the Simulator is trying to sync pasteboards between the Simulator and your Mac.

if you’re seeing this, you might be able to get around it by disabling auto-sync clipboard in the Simulator settings.

I do not expect this to be an issue on React Native’s side but rather an Apple bug.

If you’re experiencing this issue, please try following the steps as above and if you see a stack frame that involves UIConcretePasteboard it is likely this issue.

edit: more info on Apple’s forums: https://forums.developer.apple.com/thread/122972

@ozgursoy
Copy link

ozgursoy commented Oct 7, 2019

@mmmulani I tried to disabling auto-sync clipboard but not solved, app still freezes.

@mmmulani
Copy link
Contributor

mmmulani commented Oct 7, 2019

@mmmulani I tried to disabling auto-sync clipboard but not solved, app still freezes.

yeah it's not a guaranteed fix. I would try disabling auto-sync and then manually send and get the pasteboard to the Simulator.

Also try opening the Messages/Contacts app and see if any of the text boxes freeze there. Again, it looks like an UIKit bug which I hope Apple will fix in an upcoming Xcode release.

I've heard anecdotally that it doesn't repro on older versions of the Simulator, so maybe try running against iOS 12, or try testing on device.

@lcszulpo
Copy link

lcszulpo commented Oct 7, 2019

I did some tests on the simulator, crashes are occurring with Text Inputs in the bare system, in the Search Bar for example, outside react native apps. I agree with @mmmulani this is probably a UIKit bug.

@oleksandr-dziuban
Copy link

@lcszulpo Yes, just want to confirm, this is not a react native issue.
I can reproduce this on any text field in iOS 13. This is possibly iOS 13.0 Simulator issue.
Even in Safari search bar I can reproduce it.
Interesting is it fixed in iOS 13.1 Simulator. It still unavailbale

@mackenziemance
Copy link
Contributor

Yep, fixed in 13.1. This can be closed.

@oleksandr-dziuban
Copy link

oleksandr-dziuban commented Oct 8, 2019

Yep, fixed in 13.1. This can be closed.

Cool, thanks a lot! I need to install Xcode 11.1 Beta then to have iOS 13.1 Simulators
Looks like we have another critical issue with react-native and iOS 13.1.2 described in this issue:
#26696

@ozgursoy
Copy link

ozgursoy commented Oct 8, 2019

XCode 11.2 Beta works too

@oleksandr-dziuban
Copy link

oleksandr-dziuban commented Oct 9, 2019

@mackenziemance @Farad4y Unfortunately I can still see this issue on on Xcode 11.1 / iOS 13.1 simulator. It is not related to react-native I think.
I can work ~ 1h normally, after that in any app, in browser, in app if I focus on text input - app is freezing. Same for all app installed on simulator.

I think this is the Simulator issue, because it is possible to fix that if just select Hardware -> Erase all content and reinstall apps

@rborn
Copy link

rborn commented Oct 11, 2019

The last comment in the apple thread fixed for me: Simulator: Hardware > "Erase all contents and settings" + disable pastebin sync

@wesleynfreitas
Copy link

I try put

1 - import 'react-native-gesture-handler' at the top of index.js
2 - YellowBox.ignoreWarnings([
'RCTRootView cancelTouches'
]);

And don't works. Any news about the solution?

@rborn
Copy link

rborn commented Oct 16, 2019

@wesleynfreitas disable pastebin and reset the sim (as in my previous comment) and reinstall the app, it should work.

@oleksandr-dziuban
Copy link

@rborn Yes, but this issue will be reproduced later again, I reset simulator once per hour usually

@rborn
Copy link

rborn commented Oct 16, 2019

🥺

@mmmulani
Copy link
Contributor

closing this issue as it’s not caused by React Native and the later comments aren’t really helpful

@feiadan
Copy link

feiadan commented Nov 8, 2019

image

It is work for me!

@partriv
Copy link

partriv commented Nov 20, 2019

The last comment in the apple thread fixed for me: Simulator: Hardware > "Erase all contents and settings" + disable pastebin sync

this worked, I only had to disable pastebin sync and the problem was resolved. thank you.

@irfaan
Copy link

irfaan commented Mar 25, 2020

On Simulator, disable Edit > Automatically Sync Pasteboard

@GhayoorUlHaq
Copy link

The last comment in the apple thread fixed for me: Simulator: Hardware > "Erase all contents and settings" + disable pastebin sync

This worked for me. Thanks ✌️

@azhararmar
Copy link

The last comment in the apple thread fixed for me: Simulator: Hardware > "Erase all contents and settings" + disable pastebin sync

Erase all contents and settings worked for me.

@soroushchehresa
Copy link

These steps resolved my problem.

Reset simulator: Device > "Erase All Contents and Settings..."

Screen Shot 2020-11-25 at 4 18 33 PM

Disable pastebin sync: Edit > "Automatically Sync Pasteboard"

Screen Shot 2020-11-25 at 4 19 31 PM

@wobsoriano
Copy link

Erase all contents and settings worked for me in iOS 14.2

@Ericnsamba
Copy link

The last comment in the apple thread fixed for me: Simulator: Hardware > "Erase all contents and settings" + disable pastebin sync

worked for me 👍

@facebook facebook locked as resolved and limited conversation to collaborators Oct 3, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: TextInput Related to the TextInput component. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests