fix(form): bind controlled value on the Select element itself (MAPPS-270) #285
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-apps!285
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-270-inline-edit-refresh"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The shared
Selectrendered selection via per-optionselected={value == opt.value}attributes but never boundvalueon the<select>element. After an external mutation re-renders the component with a newprops.value(the ticket-detail inline Status / Priority / Assigned-To editors calltr.restart()on the ticket resource), the browser keeps the user's last click on screen instead of repainting to the new controlled value, because theselectedper-option diff is a no-op against the already-clicked option. The QA report read this as "the change failed" - the value did persist, the dropdown just refused to follow. Bindingvalue="{props.value}"on the<select>itself forces the displayed choice to follow the controlled prop, and the per-optionselectedbinding stays for the first paint before Dioxus mounts. Audited the other inline-edit dropdowns on the detail page; all of them go through this sameSelect, so the single fix covers Status, Priority, Assigned-To, and any future addition.#MAPPS-270
The shared `Select` rendered selection via per-option `selected={value == opt.value}` attributes but never bound `value` on the `<select>` element. After an external mutation re-renders the component with a new `props.value` (the ticket-detail inline Status / Priority / Assigned-To editors call `tr.restart()` on the ticket resource), the browser keeps the user's last click on screen instead of repainting to the new controlled value, because the `selected` per-option diff is a no-op against the already-clicked option. The QA report read this as "the change failed" - the value did persist, the dropdown just refused to follow. Binding `value="{props.value}"` on the `<select>` itself forces the displayed choice to follow the controlled prop, and the per-option `selected` binding stays for the first paint before Dioxus mounts. Audited the other inline-edit dropdowns on the detail page; all of them go through this same `Select`, so the single fix covers Status, Priority, Assigned-To, and any future addition. #MAPPS-270