[Bug] iOS Reddit app resets boolean form fields to defaultValue when scrolled out of view
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 56/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- ios, typescript
- Bereich
- mobile
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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)
- Vorherrschende Sprache
- TypeScript
- Sterne
- 217
- Forks
- 89
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus reddit/devvit
-
redis.expireTime() returns relative TTL seconds on live host instead of Unix timestamp secondsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
-
Bound concurrent filesystem reads during asset discovery and source ZIP generationEvtl. vergeben @CR29-22-2805 hat das vor 138 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
amosblomqvist/learnharness#1141 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
ranxianglei/billion-context#8319 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
tencent-connect/dsh-qqbot#148 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
JimLiu/open-artifact#126 ·
-
Claude Code: replace stub has no cut cue, a 6128 B Bash output reads as the one line `END6000`Offenbug repro-ready
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
mksglu/context-mode#1454 ·