-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
Children of option tags flattened when select has value #11602
Comments
Would you mind contributing a (failing) test to |
Sure, hopefully tomorrow (CET)! |
Do you want to work on a fix?
That ensures objects have the same shape which helps performance. |
Of course I tried, but I failed on the following point: currently the code concats the strings and leaves out any other children of I can push the changes I've made so far to #11911 and maybe you or another experienced dev can guide me to additional changes necessary? |
BTW: thanks for the performance explanation. |
If you have some work in progress, send a PR and we can try to take it from there. |
Done, thanks! |
Hi, the issue seems to be unassigned, can I take this one, I would love to help!!! |
There is some progress by me in #11911, as far as I am concerned you're welcome to fork it and continue in a PR of your own. I hope you get it working properly! |
Great! I will do it, thanks |
Avoid overwrite options children nodes when setting the selected option.
Avoid overwrite options children nodes when setting the selected option.
Hello, I just sent a PR with the fix. Apparently, it is caused by a regression introduced during the integration of Fiber. The As can be seen here, the previous version of the same feature only set the Since the bug was not related with |
Yes, but I needed to update the tests, the Besides that also tested using the fiddle you provided and an SSR sample project that I created to reproduce the warning error and confirm that the issue is resolved. |
Avoid overwrite options children nodes when setting the selected option.
Thanks a lot! |
This appears fixed by #13261. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When the following is rendered to string using ReactDOM:
I get
When hydrating the above code, I get this warning:
Warning: Text content did not match. Server: "a (b)" Client: "a ("
Fiddle: https://jsfiddle.net/z1q0azjL/1/
What is the expected behavior?
I should get:
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
16.1.1
This has something to do with
flattenOptionChildren
in ReactPartialRenderer.js.PS:
When browsing ReactPartialRenderer.js, I found this code:
What is the point of those
undefined
props when they are overwritten later on?The text was updated successfully, but these errors were encountered: