Closed sicks closed 8 years ago
It looks like this is actually due to the HTMLtoJSX converter. I don't think it produces the JSX necessary to maintain textarea and pre tag contents, here's a fiddle demonstrating this.
Moved this to react-magic#33 as that's where the HTMLtoJSX converter lives.
fixed in reactjs/react-magic@8b90aa3
Perfect, thanks for the note. I will update turbo-react with the latest react-magic.
Thanks! Don't forget the rails gem!
Pushed an updated version of the JS and of the Ruby gem with the update assets.
Hi. A bit of explanation could be nice. How can I render textarea with new lines? Value attribute still replaces line breaks with spaces. Default value attribute seems not working.
@tom-orrow this was fixed in reactjs/react-magic@8b90aa3, but broken again when turbo-react's version of turbolinks was updated to non-stable version, see #24.
Actually I just realized I hadn't switched back to the original turbo_react-rails gem. @ssorallen your release doesn't appear to include the newline fixes, any idea?
@sickslives turbo-react does not bundle Turbolinks any more, so turbo-react needs to the react-magic fix in order to work with Edge Turbolinks.
Is there a release of react-magic with the fix? I can update both turbo-react and turbo-react_rails with it.
@ssorallen The current master branch of react-magic includes the textarea/pre fix, I'm not sure why it didn't come through in your bundle. I got it working in my fork but since the file's minified I can't really tell why mine works and yours doesn't.
Covering all the bases, did you remember to copy the dist version over to turbo_react-rails's vendor folder after building turbo-react? :P
The commit to fix <textarea>
and <pre>
is not yet in a release for html-to-jsx. The latest is v0.2.4, but the commit is only in master: https://github.com/reactjs/react-magic/compare/release-0.2.4...master
The following rules are affecting
<textarea>
and<pre>
when the page renders:Summarized from this pull request. I was originally looking for a way to opt-out a specific element from this, but after reading how react normally works with JSX components I'm not sure how to address this if you're building your UI with something else.