ionic-team / ionic-team/ionic-framework

bug: Input in accordion does not lose focus when tapping on other parts of the accordion on Android

Aperta
#30,304 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
triage
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/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

I'm using an ion-input inside and ion-accordion which is part of an ion-accordion-group. On my Android phone and several emulators, I have the issue that the input does not lose focus after tapping on other elements inside the same ion-accordion. That means keyboard remains open and cursor blinks within the input. It does lose the focus when I tap on elements outside the accordion group.

When placing then input outside of the accordion, it loses the focus as expected when tapping somewhere else. The issue is also reproducible with a normal input element, so it's probably rather connected to the accordion than to the ion-input.

The issue is not reproducible in the web (tested Firefox and Chrome). I don't have an iOS device, so I couldn't test it there.

### Expected Behavior

When tapping on any other component, the input should lose the focus, which means the keyboard should hide and the cursor should be removed.

### Steps to Reproduce

Given the following component html:

```



Blank



Test




Test








Test



```

On an Android phone or emulator:
1. Expand the test-accordion
2. Tap on the input. It will receive the focus, keyboard appears, cursor blinks
3. Tap on the div above the input. Focus remains on the input. Keyboard still visible, cursor still blinking
Whereas doing the same with input and div outside the accordion group, the focus is removed from the input.

### Code Reproduction URL

https://github.com/wrzr123/accordion-input-test.git

### Ionic Info

Ionic:

Ionic CLI : 6.20.9 (C:\Users\...\AppData\Roaming\npm\node_modules\@ionic\cli)
Ionic Framework : not installed
@angular-devkit/build-angular : 19.2.4
@angular-devkit/schematics : 19.2.4
@angular/cli : 19.2.4
@ionic/angular-toolkit : 12.1.1

Capacitor:

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

Utility:

cordova-res (update available: 0.15.4) : 0.15.3
native-run : 2.0.1

System:

NodeJS : v22.14.0 (C:\Program Files\nodejs\node.exe)
npm : 10.8.1
OS : Windows 10

### Additional Information

_No response_

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.