Commit 143ee94
User
Force form content remount when submitted data changes
Preact/React does not reliably restore <select multiple> selection
state during in-place reconciliation of option children. Force a
complete unmount/remount of the <form> element by using a volatile
React key that increments each time submitted_data triggers a
re-render.
This ensures defaultValue is applied on mount and that the DOM
select element starts fresh with the correct selection.1 parent 37fe051 commit 143ee94
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| |||
0 commit comments