Skip to content

[Bug report] 复制文本时获取到actualText,而非显示的text #201

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

Open
liulianshanzhu opened this issue Mar 15, 2023 · 2 comments

Comments

@liulianshanzhu
Copy link

Version

10.0.1

Platforms

dart

Device Model

MI 8 Lite

flutter info

Flutter (Channel master, 3.3.4, on macOS 13.0 22A380 darwin-x64, locale zh-Hans-CN)
    • Flutter version 3.3.4 on channel master at /Users/huangzm/flutter3.3.4/flutter
    • Dart version 2.18.2
    • DevTools version 2.15.0

How to reproduce?

使用SpecialTextSpan的actualText和text,两个值不一样,复制时获取到的是actualText,而不是显示的text内容。
原因是ExtendedEditableTextState的copySelection直接使用textEditingValu获取选择的内容,而非显示的actualText,导致复制后的内容和实际显示不一样。

Logs

No response

Example code (optional)

No response

Contact

No response

@zmtzawqlp
Copy link
Member

一直就是这样设计的。复制肯定想复制原来的字符串呢。就是emoji。

@zmtzawqlp
Copy link
Member

比如你的表达是 [xxxx] 我怎么知道你页面上面显示的内容是什么呢? 所以复制只能复制原字符串

@zmtzawqlp zmtzawqlp reopened this Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants