ionic-team / ionic-team/ionic-framework

bug: toast message does not reposition correctly if it is created while the keyboard is open.

Đang mở
#29,937 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
triage
Ngôn ngữ chính
TypeScript
Star
52.7k
Fork
13.3k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
51

Mô tả

### 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

The toast messages does not correctly reposition if it was created while the Android keyboard is open and the [anchor element was used](https://ionicframework.com/docs/api/toast#positionanchor). See:
![output11](https://github.com/user-attachments/assets/5449ced2-ba96-41c6-beda-2369709b41d7)

I dont own an IOS-device. So I can not test if the issue occurs on IOS.

### Expected Behavior

The toast message should reposition correctly relative to its anchor element, even if the screen is resized due to events like the keyboard opening or closing.

### Steps to Reproduce

(Reproducible at least in Android)
1. clone the example repository
2. npm i
3. npm run build-android and deploy to your android phone
4. touch input field (keyboard will open)
5. touch button: toast is shown and keyboard should close
--> Result: Button is floating at the position above the Keyboard and does not update its position after the keyboard was closed.

It will work fine if the anchor is not used!

### Code Reproduction URL

https://github.com/tiga05/toastBug

### Ionic Info

Ionic:

Ionic CLI : 7.2.0
Ionic Framework : @ionic/angular 8.3.2
@angular-devkit/build-angular : 18.2.8
@angular-devkit/schematics : 18.2.8
@angular/cli : 18.2.8
@ionic/angular-toolkit : 11.0.1

Capacitor:

Capacitor CLI : 6.1.2
@capacitor/android : 6.1.2
@capacitor/core : 6.1.2
@capacitor/ios : not installed

Utility:

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

System:

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

### Additional Information

Sidenote:
Here is an example which show that it works correctly if it the toast was created first and THEN a keyboard was opened:
![output22](https://github.com/user-attachments/assets/a1e545b3-c309-4e49-be85-38f701a605f7)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with the linked toastBug reproduction and follow the Android steps to reproduce the anchored toast after the keyboard closes. Then trace the toast anchor-positioning behavior in the Ionic Framework source; done means the toast repositions relative to its anchor after keyboard-driven screen resizing, while preserving the existing non-anchored behavior.

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

Đánh giá

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

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.