react / react/react-native

Text inside TextInput that have background make cursor disappear

未关闭
#42,093 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Component: TextInput Issue: Author Provided Repro Needs: Attention Newer Patch Available
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

If you have TextInput with children and one of the Text elements has a background the cursor on that element disappears (only the selection marker is visible). Found this while working with react-native-syntax-highlighting that was adding background but figured out how to remove the background that was on a wrapper.

Steps to reproduce
  1. git clone https://github.com/jcubic/react-native-text-input-cursor.git
  2. cd react-native-text-input-cursor
  3. npm install
  4. npm start
React Native Version

0.72.6

Affected Platforms

Runtime - Android

Output of npx react-native info
System:
  OS: Linux 6.6 Fedora Linux 39 (Xfce)
  CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  Memory: 5.33 GB / 15.28 GB
  Shell:
    version: 5.2.21
    path: /bin/bash
Binaries:
  Node:
    version: 20.10.0
    path: ~/.nvm/versions/node/v20.10.0/bin/node
  Yarn: Not Found
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v20.10.0/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/local/rvm/rubies/ruby-2.6.10/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.6
    wanted: 0.72.6
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

I'm not sure why npx react-native info doesn't work on my system (Fedora) I do have an SDK and Android Studio.

Stacktrace or Logs
none
Reproducer

https://github.com/jcubic/react-native-text-input-cursor

Screenshots and Videos

Peek 2023-12-28 21-19

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用链接的 react-native-text-input-cursor 仓库,在 Android 上运行 npm install 和 npm start 来复现问题。然后跟踪带有背景的 Text 子元素的 React Native Android TextInput 渲染路径。当光标在这种情况下仍然可见,并且报告中的复现仍然有效时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, react-native
领域
mobile-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。