ionic-team / ionic-team/ionic-framework

bug: overlay returning focus to wrong element causes scroll

Open
#25,496 3 comments 0 reactions 0 assignees View on GitHub
package: core type: bug
Dominant language
TypeScript
Stars
52.7k
Forks
13.3k
Avg merge
1d 15h
Merged PRs (30d)
51

Description

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

- [ ] v4.x
- [ ] v5.x
- [X] v6.x
- [ ] Nightly

### Current Behavior

The scroll resets after clicking on a card.

![ion-accordion-test](https://user-images.githubusercontent.com/40690270/174295121-1491316b-35da-46ae-aca4-24270f9f0918.gif)

### Expected Behavior

The view stays in the current position.

### Steps to Reproduce

1. Install the code example
2. Scroll down
3. Click on a card

### Code Reproduction URL

https://github.com/csaar95/ion-accordion-test

### Ionic Info

Ionic:

Ionic CLI : 6.18.1 (C:\Users\Christian\AppData\Roaming\npm\node_modules\@ionic\cli)
Ionic Framework : @ionic/react 6.1.10

Capacitor:

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

Utility:

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

System:

NodeJS : v16.13.0 (C:\Program Files\nodejs\node.exe)
npm : 8.1.0
OS : Windows 10

### Additional Information

It cost me some time to exactly find out what causes this behaviour, it seems the bug only appears if there is an `IonCardHeader` with `IonCardTitle` inside the `IonCard`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.