Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting select value fails when using optgroup #6434

Closed
tanepiper opened this issue Apr 7, 2016 · 3 comments
Closed

Setting select value fails when using optgroup #6434

tanepiper opened this issue Apr 7, 2016 · 3 comments

Comments

@tanepiper
Copy link

As per this fiddle: http://jsfiddle.net/gqdzgue2/

The output of this in the select field is (edited for brevity)

<select>
  <optgroup label="Scotland">
    <option value="Fife" label="Fife">Fife</option>
    <option value="Midlothian" label="Midlothian">Midlothian</option>
  </optgroup>
</select>

When passing into the select field the value of "Midlothian" it is still showing "Fife" as the selected value.

However it does seem that it possibly works with defaultValue being passed (http://jsfiddle.net/w12xwd3z/6/) however it does not work with both being passed: http://jsfiddle.net/h34yL9yu/

@gaearon
Copy link
Collaborator

gaearon commented Apr 7, 2016

There is a typo in the fiddle. You are passing “Midlothain” but the value is “Midlothian”.
The fiddle works with the typo fixed: http://jsfiddle.net/j03c41pw/

Please let me know if I missed something! So far this appears to work as intended so closing.

@gaearon gaearon closed this as completed Apr 7, 2016
@tanepiper
Copy link
Author

@gaearon Looks like #6440 references the same issue. The JSFiddle did work because it's react 0.14 - but can confirm it's not working in 15

@gaearon
Copy link
Collaborator

gaearon commented Apr 8, 2016

Let's discuss it there then? 🙂

It's a fun coincidence but I wouldn't say it's the same issue, as here the issue was the typo, and in the other issue, it is a genuine regression caused by a bugfix that was never released in RCs so it couldn't cause any issues before the final 15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants