bug: ion-datetime (and other components) throw `instance[watchMethodName] is not a function` when used inside inline IonModal (React)

未關閉
#30,925 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
42/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
react, typescript
領域
frontend

研究方向

首先,使用針對 isOpen、min 和 value 所示的 prop 組合,執行包含 IonModal 和 IonDatetime 的 React 範例。追蹤受影響元件之間與 overlay 相關的元件行為,並判斷受支援的結果是安全地更新 prop,還是記錄不受支援模式的文件。完成的標準是重現不再擲出例外,或清楚記錄該限制。

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

描述

package: core stencil type: bug
Prerequisites
Ionic Framework Version

v7.x

Current Behavior
TypeError: instance[watchMethodName] is not a function
    at Datetime.set [as min]
    at attributeChangedCallback
Expected Behavior

Ionic components should not throw runtime errors when used inside IonModal, even when controlled via React props.

At minimum:
• setting props like min, value, or isOpen should be safe
• or Ionic should document that this pattern is unsupported

Steps to Reproduce
const Example = () => {
  const [open, setOpen] = useState(true);

  return (
    <IonModal isOpen={open}>
      <IonDatetime
        presentation="date"
        min="2026-01-19"
        value="2026-01-20"
      />
    </IonModal>
  );
};
Code Reproduction URL

null

Ionic Info

This affects multiple components that using Overlay

Additional Information

No response

主要語言
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 摘要。