-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Image nested within TextInput will be invisible #18566
Comments
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
I'm also interested in this functionality. I have the same use case regarding emojis, I'd like to display emoji images (from Twemoji) inside a |
We need that too 👍 |
@juanscilingo did you find a solution? |
@juanscilingo @EgidioCaprino got any solution on that ? |
any update on this? anyone ? |
So, i'd like to display images inside a |
hope this can be prioritized.. |
Im currently getting an issue with 0.57 on iOS, about not being allowed to nest Views inside Text components. This is similar I see to whats reported on Android... only that Im now getting this on iOS. |
Is this the reason why stickers don't work in RN? :-| |
Thank you for sending this informative issue. I've labeled it accordingly and our team will look into it in the future. If anyone wants to take a stab at implementing it, please do it! |
Did you find a solution for cross platform emoji support? (I need it for react native on iOS, Android and web to work, and preferably get a notification if the user uses an unsupported newer emoji) |
@wumke Flutter was my solution. Rn is garbage. 😂 Jokes aside, I had to create my own custom native solution using the clipboard in iOS and copy/paste file mangers in Android was a pretty hard task. |
The same is for react native 0.59.8. |
Really wanting this to be fixed, need Views to be inside the TextInput |
This issue was originally created by me in #17468. I love React Native, it made my dream come true: Launch my first iOS app in App Store. However, RN has been released for more than 4 years, it's still 0.x version, which means there are lots of defects need to be resolved to enhanced. For my next iOS app, instead of spending time to come to community for such weird or unsupported issues, I'd like to learn Swift. |
@OllyDixon Do you have some of your code in an open source repo? Does it have the same user experience as whatsapp? |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
There were a few similar issues before this one that got closed by the bot (facebook/react-native#17467 & facebook/react-native#17468) because it's missing information or went stale. The author open a stack overflow question that did not get answer.
Here's my attempt to provide a more complete argument and be as informative as possible to help push this feature request/bug fix forward.
I'm aware that
<TextInput />
usesSpannableString
in Android andNSAttributedString
in iOS underneath, both are capable of inlining image (Android withImageSpan
and iOS withNSTextAttachment
). But this is not supported by React Native as ofv0.54.2
.To be specific, I'm talking about
<Image />
nested within<Text />
nested within<TextInput multiline />
.One of the use case is to support custom emoji as described by @just4fun in facebook/react-native#17468 in the GIF below:
Environment
Steps to Reproduce
A react native project have been created at lxcid/ReactNativeBug-NestedViewInTextInput. You can pull it down locally and launch the project with
react-native run-ios
orreact-native run-android
.Expected Behavior
At minimum, I would hope for
<TextInput>
+<Text>
+<Image>
to work as expected in iOS and Android. For example:But if we are able to support
<TextInput>
+<Text>
+<View>
as well, that would be awesome!Actual Behavior
Text + Image
First of all,
<Text />
do support nested images, even though its not well documented. There might be some rendering differences between iOS and Android, but they are generally supported.Text + View
As for nested views in
<Text />
, only iOS is supported. This is documented here.TextInput + Image
Surprisingly, for
<Image />
nested within<Text />
nested within<TextInput />
, It worked for Android but not so much for iOS, which did not display the image.TextInput + View
As for nested views in
<TextInput />
, Android crashes while iOS does not display the image.Summary
I create a table to summarize and compare what we have observed here:
<Text>
+<Image>
<Text>
+<View>
<TextInput>
+<Text>
+<Image>
<TextInput>
+<Text>
+<View>
The text was updated successfully, but these errors were encountered: