Setting caretHidden for a TextInput component on iOS (iPhone SE 3) causes continuous metal rendering errors
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 68/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- ios, objective-c, react-native
- Domínio
- mobile
Direção de pesquisa
Reproduza o problema com o app de exemplo obrigatório usando npm install e npm run ios -- --simulator="iPhone SE 3" e, em seguida, inspecione RCTUITextField.mm próximo à linha 216 e RCTUITextView.mm próximo às linhas 369-378. Compare o comportamento com caretHidden habilitado e revise os logs do Metal enquanto o campo estiver em foco. Considera-se concluído quando os erros contínuos Surface 1073741823 x 1073741823 is too large não ocorrerem mais no caso reproduzido de iOS TextInput.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
Setting the caretHidden prop on a <TextInput> component when rendered on iOS results in an error that spams the iOS logs (~ 20-30 times per second):
Surface 1073741823 x 1073741823 is too large
As the error is generated so frequently this creates a lot of activity on the app. In my use case this is causing XCUITest to wait continuously for the app to be idle which never happens, so our end to end tests tend to stall when displaying a text input with a hidden caret.
We are using the iPhone SE 3 in the simulator for our testing which shows the error, it does not seem to occur with the iPhone 17 Pro, I haven't tested other phones but the obvious difference is the home button on the SE 3. I was able to reproduce this problem on a fresh v0.87 metro app with a single text input.
I believe this may be due to calculations that use the caret position that run even though the caret is not displayed, though I'm not 100% sure.
RCTUITextField.mm (for single line input) and RCTUITextView.mm for multi line input both set the caret to CGRectZero which would give it dimensions and size of 0, which I could see causing the problem, though I'm not sure what code is using these values for calculations.
Steps to reproduce
- Install the app with
npm install - Run the app on iOS on the iPhone SE 3 with
npm run ios -- --simulator="iPhone SE 3" - Open the Console.app and start viewing logs for the simulator (you can filter by
metalto make the error more clear) - Focus the input field by tapping on it
- Check the errors in the console app
React Native Version
0.87.1
Affected Platforms
Runtime - iOS
Output of npx @react-native-community/cli info
System:
OS: macOS 26.6.2
CPU: (14) arm64 Apple M4 Pro
Memory: 435.84 MB / 48.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 24.11.0
path: /Users/mario/.local/share/mise/installs/node/24.11.0/bin/node
Yarn:
version: 1.22.22
path: /Users/mario/.local/share/mise/installs/node/24.11.0/bin/yarn
npm:
version: 11.6.1
path: /Users/mario/.local/share/mise/installs/node/24.11.0/bin/npm
Watchman:
version: 2026.01.12.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /Users/mario/.local/share/mise/installs/ruby/3.4.8/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 25.2
- iOS 26.2
- macOS 26.2
- tvOS 26.2
- visionOS 26.2
- watchOS 26.2
Android SDK:
API Levels:
- "29"
- "33"
- "35"
- "36"
Build Tools:
- 33.0.2
- 35.0.0
- 36.0.0
System Images:
- android-28 | Google APIs ARM 64 v8a
- android-29 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2025.3 AI-253.32098.37.2534.15336583
Xcode:
version: 26.2/17C52
path: /usr/bin/xcodebuild
Languages:
Java:
version: javac 17
path: /Users/mario/.local/share/mise/shims/javac
Ruby:
version: 3.4.8
path: /Users/mario/.local/share/mise/installs/ruby/3.4.8/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.2.0
wanted: 20.2.0
react:
installed: 19.2.3
wanted: 19.2.3
react-native:
installed: 0.87.1
wanted: 0.87.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
Stacktrace or Logs
Subsystem: com.apple.coreanimation
Category: Metal
Surface 1073741823 x 1073741823 is too large
MANDATORY Reproducer
https://github.com/mariovisic/react-native-example-ios-carret-error
Screenshots and Videos
- Linguagem predominante
- C++
- Estrelas
- 127k
- Forks
- 25.3k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de react/react-native
-
Needs: Author Feedback Needs: Repro
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
react/react-native#58659 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Needs: Author Feedback Needs: Repro
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
react/react-native#58621 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Add TypeScript declaration for the performance globalTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. AbertaNeeds: Attention Needs: Repro
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
react/react-native#58610 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
-
Needs: Triage :mag:
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
react/react-native#58565 · 2 comentários · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
[Android][Fabric] addViewAt hard-crashes on a placeholder ViewState synthesised by updateEventEmitterTalvez já em andamento @wneel assumiu há 21 dias. AbertaNeeds: Attention Needs: Repro
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
react/react-native#58526 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de react/react-native
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
ws_bridge: stripping format=evr for matchmaker connections can concatenate the path and queryAbertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
EchoTools/nevr-runtime#116 ·
Mantenedores costumam responder em até 1 dia
-
code-quality libc++
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
llvm/llvm-project#229284 ·
Mantenedores costumam responder em até 1 dia
-
test-issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
llvm/offload-test-suite#1557 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia