ionic-team / ionic-team/ionic-framework

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

未关闭
#30,304 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
triage
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 15 小时
30 天内合并 PR
51

描述

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

贡献指南

打开贡献指南

调研方向

Start with the linked accordion-input-test reproduction on an Android phone or emulator, then locate the ion-accordion implementation and related tests in this repository. Compare tapping inside and outside the accordion, including the web behavior. Done means tapping another element inside the accordion removes input focus and hides the keyboard without regressing the existing behavior.

由索引模型根据 Issue 内容生成。

评估

技术栈
android, angular, typescript
领域
frontend, mobile-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。