KITFORMA · EDITORIAL ANSWER
Why does selected on a React option not control the selection?
KitForma editorial guide. Control the select element itself: <select value={city} onChange={e => setCity(e.target.value)}> with option values matching city.
Step-by-step answer
<select value={city} onChange={e => setCity(e.target.value)}> with option values matching city. For multiple selection, value must be an array and updates should read selectedOptions. Use defaultValue for an uncontrolled initial selection. Verify the selected value after a programmatic state update and after a user change; do not mix selected attributes with React’s parent-level control.Sources and verification
Sources checked:
Scope: This editorial guide is based on the cited sources and tool behavior. A forum question or a query observed for our site does not establish market search volume, low competition, guaranteed rankings or inadequate answers elsewhere.
This editorial answer was prepared by KitForma with AI assistance. It is not presented as a real member question or an independent user review. Check the sources and the result with your own file; report corrections in the discussion.