ionic-team / ionic-team/ionic-framework

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

Aperta
#25,023 4 commenti 6 reazioni 0 assegnatari Vedi su GitHub
package: core type: bug
Lingua principale
TypeScript
Stelle
52.7k
Fork
13.3k
Merge medio
1g 15h
PR unite (30g)
51

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.