ionic-team / ionic-team/ionic-framework

bug: popover position does not update when viewport is resized or rotated

オープン
#25,023 コメント 4 件 リアクション 6 件 担当者 0 名 GitHub で見る
package: core type: bug
主要言語
TypeScript
スター
52.7k
フォーク
13.3k
平均マージ
1日 15時間
マージ済み PR(30日)
51

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the popover example at the linked ionic-docs static demo and reproduce the misplaced popover after browser resize or orientation change. Trace the Ionic popover implementation that the demo exercises and determine whether completion should reposition the popover or close it when the viewport or layout changes; verify the chosen behavior against the reproduction, including ion-select popovers.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。