[Bug] iOS Reddit app resets boolean form fields to defaultValue when scrolled out of view
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 56/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- ios, typescript
- 領域
- mobile
研究方向
Start by tracing how Devvit.createForm and context.ui.showForm pass boolean field state to the iOS form controls, then find where recycled cells initialize their toggle values. Compare that path with the working Android or desktop behavior. Done means a toggled value stays visible after scrolling off-screen and is submitted correctly on iOS; verify with the reproduction steps in the issue.
由索引模型根據 Issue 內容生成。
描述
Description
When using Devvit.createForm (or context.ui.showForm), fields of type: "boolean" reset to their defaultValue when scrolled out of the visible viewport in the iOS Reddit app.
When a user toggles a boolean switch, scrolls down to complete the rest of the form, and taps the submit button, the reset defaultValue is submitted in the FormOnSubmitEvent.values payload rather than the user's toggled state.
Platform Comparison
- iOS Reddit app (Bug): Toggling a boolean, scrolling it out of view, and scrolling back up shows the toggle visibly snapped back to
defaultValue. Submitting sendsdefaultValue. - Android Reddit app: Works properly. Toggled state is preserved across scrolling/view recycling.
- Desktop Web: Works properly.
Steps to Reproduce
- Define a form with enough fields to require scrolling on mobile, placing a
type: "boolean"field withdefaultValue: trueat the top:
Devvit.createForm(
{
title: "Test Form",
acceptLabel: "Save",
fields: [
{
name: "enable_feature",
label: "Enable Feature",
type: "boolean",
defaultValue: true,
},
{ name: "field_1", label: "Option 1", type: "string" },
{ name: "field_2", label: "Option 2", type: "string" },
{ name: "field_3", label: "Option 3", type: "string" },
{ name: "field_4", label: "Option 4", type: "string" },
{ name: "field_5", label: "Option 5", type: "string" },
],
},
(event, context) => {
console.log("Submitted values:", event.values);
}
);
- Open the form on the iOS Reddit app.
- Toggle
enable_featurefromtruetofalse. - Scroll down until the
enable_featureswitch is completely off-screen. - Either scroll back up (the toggle will have visibly snapped back to
true), or tap "Save". - Inspect the submitted
event.valuesin logs.
Expected Behavior
Form field state should persist across list/cell recycling on iOS, matching Android and Desktop Web.
Observed Behavior
On iOS, event.values.enable_feature arrives as true (defaultValue). The native iOS cell recycling re-initializes the toggle control from field.defaultValue rather than reading from the active form state model.
Environment
- Devvit version:
0.14.8 - Client: Reddit Mobile App (iOS)
- 主要語言
- TypeScript
- 星號
- 217
- 分支
- 89
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
reddit/devvit 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 1/5 1 小時以內 新手友好度 85/100
-
難度 2/5 1-3 小時 新手友好度 67/100
-
Bound concurrent filesystem reads during asset discovery and source ZIP generation可能已有人在做 @CR29-22-2805 於 138 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
-
難度 2/5 1-3 小時 新手友好度 65/100
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 95/100
amosblomqvist/learnharness#1141 ·
維護者通常 4 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
ranxianglei/billion-context#8319 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
tencent-connect/dsh-qqbot#148 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
JimLiu/open-artifact#126 ·
-
bug repro-ready
難度 2/5 1-3 小時 新手友好度 86/100
mksglu/context-mode#1454 ·