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

[TextInput] Image nested in TextInput will be invisible #17468

Closed
just4fun opened this issue Jan 6, 2018 · 8 comments
Closed

[TextInput] Image nested in TextInput will be invisible #17468

just4fun opened this issue Jan 6, 2018 · 8 comments
Labels
Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@just4fun
Copy link

just4fun commented Jan 6, 2018

Is this a bug report?

Yes.

Have you read the Contributing Guidelines?

Yes.

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 7.7.4
Yarn: -
npm: 4.1.2
Watchman: 4.1.0
Xcode: 9.2.0
Android Studio: -

Packages: (wanted => installed)
react-native: 0.42.2 => 0.42.2
react: 15.4.2 => 15.4.2

Target Platform: iOS (11)

Steps to Reproduce

(Write your steps here:)

  1. Create a <TextInput>
  2. Nest a <Image> within <TextInput>

Expected Behavior

(Write what you thought would happen.)

  1. The <Image> could be displayed within <TextInput>
  2. The <Image> could be removed with pressing delete button.

Actual Behavior

  1. <Image> will be invisible but it seems like it occupied same space with the width and height we set to <Image>
  2. There is also cursor around the invisible image, but when we press delete button, sometimes the space could not be removed. If we move the cursor around the invisible image back and forth and try to press delete button again, the space will be removed

In addition, I know in iOS we could use NSAttributedString while using SpannableString in Android, but not sure how we could archive inserting custom image into <TextInput> with React Native.

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

https://stackoverflow.com/questions/45062363/react-native-image-inside-multiline-textinput

(https://snack.expo.io/ is really slow in China, so I use the same issue on stack overflow here, there is screenshot there.)

@eballeste
Copy link

Not sure what you are trying to do with images within a TextInput... never seen this before. What are you trying to achieve? Maybe it's best to figure out how to do layouts with Views and flex rules.

@just4fun
Copy link
Author

just4fun commented Jan 11, 2018

@eballeste - So you know we could insert emoji into TextInput with iOS emoji keyboard, however, I'm working on a BBS app and the BBS has custom emojis (pictures), so I created a emoji picker component (like iOS emoji keyboard). When I tap the custom emoji, the only thing I can do it to insert the code of custom emoji (1 code is mapping to 1 custom emoji) into TextInput. To give user a better experience, it's definitely better to display the custom emoji we tapped into TextInput directly.

@just4fun
Copy link
Author

custom_emoji

@just4fun
Copy link
Author

Anyone has idea on this ticket? It's common case in social app in my opinion.

@hoyajigi
Copy link

I have the same issue😭

@just4fun
Copy link
Author

If we are building a social app, this case is very common unless we only use iOS built-in emojis.

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@lxcid
Copy link

lxcid commented Mar 25, 2018

Would love for this to be supported as well. I would say custom view will be amazing…

@facebook facebook locked and limited conversation to collaborators May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants