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

After textarea sets autoSize, the cursor will move to the end of continuous input of text. #5922

Closed
1 task
qpxtWhite opened this issue Aug 26, 2022 · 7 comments

Comments

@qpxtWhite
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.3.0-beta.2

Environment

win10\chrome\vue3

Reproduction link

Edit on CodeSandbox

Steps to reproduce

1、a-textarea设定 :auto-size="{ minRows: 2, maxRows: 5 }"
2、在输入框中将光标定位到文案中间
3、连续快速的输入中文
a

What is expected?

正常在文案中间插入字符

What is actually happening?

光标会移动到最后,导致输入位置错误

@github-actions github-actions bot changed the title textarea设定autoSize之后,连续输入文字,光标会移动到最后 After textarea sets autoSize, the cursor will move to the end of continuous input of text. Aug 26, 2022
@tangjinzhou
Copy link
Member

mac 搜狗没有复现

@github-actions
Copy link

github-actions bot commented Sep 1, 2022

Hello @qpxtWhite. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch, fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!

你好 @qpxtWhite,我们完全同意你的提议/反馈,欢迎直接在此仓库创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支,务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。

@qpxtWhite
Copy link
Author

Add one console line here:
image

And get the following result:
a
currentStart suddenly jump to 111

I dont know why

@hymsnow
Copy link

hymsnow commented Sep 22, 2022

我也出现了和你一模一样的问题,我的操作方式是这样的:比如同时不停的按 B(或者其他字母也行)+空格键

QQ截图20220922100309
后面我发现导致此原因主要是 因为加了 :autosize="{ minRows: 4, maxRows: 20 }" 这句,去掉后就不会出现

@qpxtWhite
Copy link
Author

qpxtWhite commented Oct 2, 2022

在ResizableTextArea.tsx文件中,会根据resizeStatus设置overflow属性;
经过一番调试,发现去掉这个overflow样式变化之后,不会再出现光标乱跳的问题,如截图这段代码:
image
我不确定这个overflow属性是用来干嘛的,能不能去掉,去掉会不会影响其他功能;
我在项目里复制了一份textarea组件,去掉了红框中的代码,暂时跑着没问题

@github-actions
Copy link

github-actions bot commented Dec 2, 2022

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants