You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiline TextInput in React Native supports components as children. Along with #795 and #793, this may require switching to contentEditable for the multiline implementation, if not the single-line input.
@voidstarfire Thanks! How does React manage when a user edits the contentEditable content that is produced by components React renders? I heard that was one of the difficulties with contentEditable but haven't made time to experiment myself yet. Any more feedback you can include would be really helpful
@necolas My bad I was speaking from a Markdown perspective mostly.
Speaking from a <TextInput> only perspective it seems to work pretty well. The react-native-web <Text> components stack fine and inside contentEditable they seem to work with styles just fine, even when backspacing until you have no content. Although I imagine there will be a lot of empty <Text>{wasContent}</Text> around; hence some sort of filter.
@OllyDixon How are you using quilljs in native cuz there's no native supported quill yet, right? (If webview, then though it may work for various devices, it's still not purely native and can have unexpected behaviour)
@OllyDixon It's not that difficult to make a simple native rich text editor. My (partial) solution includes using nested inside . However, react-native-web doesn't support this as it renders either textarea or input tags (neither of them supports children tags). #1380: I've discussed the same in this issue. A probable solution would be to replace the TextInput version (textarea or input) react-native-web to content-editable divs.
Activity
ollyde commentedon Dec 6, 2018
Slate doesn't play so nice with mobile unfortunately. Same with DraftJS.
The easiest solution is just wrap each one in it's own native renderer function that spits out the following:
SubComponent
Web
Mobile
PS Really awesome library I'm using this to create cross platform apps (Web, Electron, React-Native) and it's going epic. Wish I could donate!
necolas commentedon Dec 6, 2018
@voidstarfire Thanks! How does React manage when a user edits the contentEditable content that is produced by components React renders? I heard that was one of the difficulties with contentEditable but haven't made time to experiment myself yet. Any more feedback you can include would be really helpful
ollyde commentedon Dec 6, 2018
I'm playing with that just now.
It seems to work really well so far. The
<Text/>components just wrap around the text. As long as you stick with<Text>only components. No views.Seems we have to create some sort of generator to filter out empty text components and fill in styled ones. Should work well with React-native-web.
I will get back probably mid next week with my results :-)
Here's some examples if you're interested. @necolas
I'm actually creating a cross-platform native Markdown editor (Not just viewer) from scratch in React.
Sub component.
Mobile
Desktop / Web
necolas commentedon Dec 6, 2018
What does that mean?
ollyde commentedon Dec 6, 2018
@necolas My bad I was speaking from a Markdown perspective mostly.
Speaking from a
<TextInput>only perspective it seems to work pretty well. The react-native-web<Text>components stack fine and inside contentEditable they seem to work with styles just fine, even when backspacing until you have no content. Although I imagine there will be a lot of empty<Text>{wasContent}</Text>around; hence some sort of filter.shakeabi commentedon Jul 11, 2019
@OllyDixon How is the development going?
ollyde commentedon Jul 11, 2019
@shakeabi I'm using a library called Quill, worked great for mobile and web :-)
shakeabi commentedon Jul 11, 2019
@OllyDixon How are you using quilljs in native cuz there's no native supported quill yet, right? (If webview, then though it may work for various devices, it's still not purely native and can have unexpected behaviour)
ollyde commentedon Jul 11, 2019
@shakeabi there was no native solution that included an editor.
shakeabi commentedon Jul 11, 2019
@OllyDixon It's not that difficult to make a simple native rich text editor. My (partial) solution includes using nested inside . However, react-native-web doesn't support this as it renders either textarea or input tags (neither of them supports children tags). #1380: I've discussed the same in this issue. A probable solution would be to replace the TextInput version (textarea or input) react-native-web to content-editable divs.
ollyde commentedon Jul 11, 2019
@shakeabi yes I discovered this as well. I no longer do React Native anymore though. Flutter is much better :-)