bug: Keep error text space to prevent layout shifting and keep border visible

未關閉
#31,030 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
angular, typescript
領域
frontend

研究方向

此報告聚焦於 Ionic v8 Angular 應用程式中的 ion-input 及其 input-bottom.sc-ion-input-md 元素。首先使用提供的標記在全新的 Angular 專案中重現此行為,接著檢查 ion-input 的實作及其錯誤狀態的渲染。當有效輸入保留 error-text 所需的空間和邊框,且版面配置不會發生偏移時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

community feedback wanted

It would be great if we can keep the input-bottom.sc-ion-input-md element, even if the input is valid. Because 1. layout shifting and 2. missing border. Removing the element with border (which changes element size) removes the border and causes layout changes. And it would be great if we keep the space for the error text.

<ion-input
  label="Name"
  labelPlacement="floating"
  formControlName="name"
  errorText="Blah blah blah"
>
</ion-input>

Image

You can see that the layout shifts and in the end the border disappears.

Ionic v8, Angular v19, Chrome 146.0.7680.153

Workaround: Remove errorText and make your own by using control errors in element below and use ion-item in this case for the line or use css for this. I cannot reproduce this is stackblitz, but in a fresh new Angular project with same setup. No custom stuff. It's weird, but there is something wrong.

主要語言
TypeScript
星號
52.8k
分支
13.3k
平均合併
3 天 1 小時
30 天內合併 PR
86

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ionic-team/ionic-framework 的其他 Issue

查看 ionic-team/ionic-framework 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。