ionic-team / ionic-team/ionic-framework

bug: ion-textarea scrolls to top on mobile when tapping padding area in long text

未关闭
#30,568 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
triage
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 15 小时
30 天内合并 PR
51

描述

### Prerequisites

- [x] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [x] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [x] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

v8.x

### Current Behavior

There is a strange behavior with on mobile devices. When the textarea contains a long amount of text (e.g., 1,500+ characters), and the user scrolls to the bottom of the text and places the cursor near the last lines, tapping on the padding area (outside the actual text but inside the textarea) causes the view to scroll the textarea to the top instead of keeping the focus at the cursor's position.

This issue does not happen when tapping directly on the text. It only occurs when tapping the empty padding area inside the textarea.

### Expected Behavior

The view should scroll to keep the cursor in view, especially if the user taps near the last lines of a long text.

### Steps to Reproduce

1. On a mobile device, open an with auto-grow="true" and a long text value (~1,500 characters).

2. Scroll to the bottom of the textarea and put the cursor in one os the last lines.

3. Tap on an empty area (x padding) beside the text (but still within the textarea).

4. The view jumps to the top of the textarea, even though the cursor remains near the bottom.

### Code Reproduction URL

Please request an admin access to my website if it cannot be reproduced.

### Ionic Info

Ionic:

Ionic CLI : 6.19.0 (C:\Users\User\AppData\Roaming\npm\node_modules\@ionic\cli)
Ionic Framework : @ionic/vue 8.6.5

Capacitor:

Capacitor CLI : 7.4.2
@capacitor/android : 7.2.0
@capacitor/core : 7.4.2
@capacitor/ios : 7.4.2

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.19.0 (C:\Program Files\nodejs\node.exe)
npm : 10.8.2
OS : Windows 10

### Additional Information

_No response_

贡献指南

打开贡献指南

调研方向

Start by locating the ion-textarea component implementation and its mobile focus and scroll handling; the issue names no source file or test. Reproduce with auto-grow and roughly 1,500 characters, then verify that tapping the horizontal padding near the final lines keeps the cursor and view in place.

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

评估

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

把新 issue 发到你的邮箱

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