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

Đang mở
#30,568 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
frontend, mobile-dev

Hướng nghiên cứu

Bắt đầu bằng cách xác định phần triển khai của component ion-textarea và cách xử lý focus cũng như cuộn trên thiết bị di động; issue không nêu tệp mã nguồn hay bài kiểm thử nào. Tái hiện với auto-grow và khoảng 1.500 ký tự, sau đó xác minh rằng việc chạm vào padding ngang gần các dòng cuối vẫn giữ nguyên vị trí của con trỏ và chế độ hiển thị.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

triage
Prerequisites
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

Ngôn ngữ chính
TypeScript
Star
52.8k
Fork
13.3k
Merge trung bình
3 ngày 1 giờ
Pull request đã merge (30 ngày)
86

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ionic-team/ionic-framework

Tất cả issue của ionic-team/ionic-framework

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.