ionic-team / ionic-team/ionic-framework
bug: popover position does not update when viewport is resized or rotated
- Ngôn ngữ chính
- TypeScript
- Star
- 52.7k
- Fork
- 13.3k
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 50
Mô tả
### Prerequisites
- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/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
- [X] v4.x
- [X] v5.x
- [X] v6.x
### Current Behavior
Same issue as described in https://github.com/ionic-team/ionic-framework/issues/10139 which was not resolved. After resize or screen orientation change, the popover can be misplaced or even be outside of the visible area.
This could also be triggered if there is a layout shift. For example if the popover has no backdrop and the user toggles the ion-split-pane.
### Expected Behavior
Popoverer gets moved when resized or the screen orientation changes. If this is too complicated at least close the popover on resize.
### Steps to Reproduce
Run the example from the [docs](https://github.com/ionic-team/ionic-docs/blob/main/static/demos/api/popover/index.html) with chrome and check the behavior on resize.
### Code Reproduction URL
https://raw.githubusercontent.com/ionic-team/ionic-docs/main/static/demos/api/popover/index.html
### Ionic Info
Ionic:
Ionic CLI : 6.19.0 (/home/wolf/.config/yarn/global/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.0.13
@angular-devkit/build-angular : 13.3.0
@angular-devkit/schematics : 13.3.0
@angular/cli : 13.3.0
@ionic/angular-toolkit : 6.1.0
Capacitor:
Capacitor CLI : 3.4.3
@capacitor/android : 3.4.3
@capacitor/core : 3.4.3
@capacitor/ios : 3.4.3
Utility:
cordova-res : not installed globally
native-run : 1.5.0
System:
NodeJS : v14.19.1 (/usr/bin/node)
npm : 6.14.16
OS : Linux 5.13
### Additional Information
I tired to implement the "close popover on resize" behavior with a ResizeObserver, but had trouble when using a ion-select with popover interface. There seems to be no way to close that popover programmatically.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với ví dụ popover trong bản demo tĩnh ionic-docs được liên kết và tái hiện popover bị đặt sai vị trí sau khi thay đổi kích thước trình duyệt hoặc thay đổi hướng. Theo dõi triển khai Ionic popover mà bản demo thực thi và xác định xem khi hoàn tất, popover nên được định vị lại hay đóng khi viewport hoặc layout thay đổi; kiểm tra hành vi đã chọn dựa trên kết quả tái hiện, bao gồm cả các popover ion-select.
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
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 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
- 35/100