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

[v0.74.1]Cursor prop is causing crash on Text #44559

Open
alantoa opened this issue May 13, 2024 · 2 comments
Open

[v0.74.1]Cursor prop is causing crash on Text #44559

alantoa opened this issue May 13, 2024 · 2 comments
Labels
Resolution: PR Submitted A pull request with a fix has been provided.

Comments

@alantoa
Copy link

alantoa commented May 13, 2024

Description

I have noticed that when I set the cursor: 'pointer' for the Text component, the app breaks, although it works well for View.

CleanShot.2024-05-14.at.03.51.46.mp4

Steps to reproduce

Set the cursor: 'pointer' style prop for the Text component in react-native.

<Text style={{ cursor: "pointer" }}>Hey, there!👋</Text>

React Native Version

0.74.1

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1 Pro
  Memory: 266.41 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.5.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 9.5.1
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.14.3
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK:
    API Levels:
      - "26"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 33.0.1
      - 34.0.0
    System Images:
      - android-26 | Google APIs Intel x86 Atom_64
      - android-34 | Google Play ARM 64 v8a
    Android NDK: Not Found

Stacktrace or Logs

Exception thrown while executing UI block: -[RCTTextView setCursor:]: unrecognized selector sent to instance 0x1082f4290

__44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke
    RCTUIManager.m:1165
__44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.143
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_drain
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start_sim
0x0
0x0

Reproducer

https://snack.expo.dev/@alantoa/cursor-prop-is-causing-crash-on-text

Screenshots and Videos

CleanShot.2024-05-14.at.03.51.46.mp4
@alantoa
Copy link
Author

alantoa commented May 13, 2024

Hey @Saadnajmi, I know that the cursor prop feature is your contribution, and thank you for your great PR!

I understand that maybe it is unnecessary to set it for Text in VisionOS, but sometimes we need to use it for RN Web. So I'm wondering if we can just ignore this prop on Text instead of throwing an error?

@Saadnajmi
Copy link
Contributor

Saadnajmi commented May 13, 2024

EDIT: Fix onto main, which I guess can be picked if it lands? #44563

Ah yeah this is a legitimate bug. We should either allow you to set cursor on Text, or filter it out (presumably by not including it in Text's ViewConfig). I can look into what works in a bit.

Initial testing, this only reproes on the old architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: PR Submitted A pull request with a fix has been provided.
Projects
None yet
Development

No branches or pull requests

3 participants