ionic-team / ionic-team/ionic-framework

bug: Ion-input not showing error border input until second time focus out (ion-untouched is not changing to ion-touched only on second time focus out).

未关闭
#30,840 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
package: angular package: core type: bug
主要语言
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

When the user clicks into the input field and focuses out for the first time, the error border/outline does not appear. It only shows up after the second time the user focuses out of the input.

https://github.com/user-attachments/assets/2f35d08f-5d4c-40ac-8deb-d99f4af008fa

### Expected Behavior

When the user clicks into the input field and then focuses out (blur event) for the first time, the input should immediately display the error border/outline if the value is invalid or empty.

https://github.com/user-attachments/assets/69dbf67d-e99b-4054-85fe-1cf613e12bb1

### Steps to Reproduce

1. Clone the project below
2. Run `npm install` to install dependencies
3. Run `npx nx serve tripcard` to run the project
4. Open the application in [http://localhost:4200](http://localhost:4200)
5. Then you could be able to reproduce the issue like acted in the video, in current behaviour section.

### Code Reproduction URL

https://github.com/Av1nag/ionic-input-untouched-issue

### Ionic Info

Note: I got info by making these steps

```bash
cd apps/tripcard
npx ionic info
```
Ionic:

Ionic CLI : 5.4.16 (/Users/gaddamsampathreddy/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic)
Ionic Framework : @ionic/angular 8.7.11 (/Users/gaddamsampathreddy/oaks/ionic-input-untouched-issue/node_modules/@ionic/angular)
@angular-devkit/build-angular : not installed
@angular-devkit/schematics : 20.2.2 (/Users/gaddamsampathreddy/oaks/ionic-input-untouched-issue/node_modules/@angular-devkit/schematics)
@angular/cli : 20.2.2 (/Users/gaddamsampathreddy/oaks/ionic-input-untouched-issue/node_modules/@angular/cli)
@ionic/angular-toolkit : not installed

Capacitor:

Capacitor CLI : 7.4.4
@capacitor/core : 7.4.4 (/Users/gaddamsampathreddy/oaks/ionic-input-untouched-issue/node_modules/@capacitor/core)

Utility:

cordova-res : not installed
native-run : 2.0.1

System:

NodeJS : v22.21.1 (/Users/gaddamsampathreddy/.nvm/versions/node/v22.21.1/bin/node)
npm : 10.9.4
OS : macOS Unknown

### Additional Information

This is not a typical ionic project which could be created using ionic cli. We've created this project using NX workspaces. And, I've no idea if that is driving the issue.

贡献指南

打开贡献指南

调研方向

Reproduce the issue from the linked project by running npm install and npx nx serve tripcard, then inspect the ion-input focus and blur behavior involved in the touched state. Done means the first blur of an invalid or empty input immediately shows the error border or outline, rather than requiring a second focus-out.

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

评估

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

把新 issue 发到你的邮箱

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