Skip to content

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

Closed
@just4fun

Description

@just4fun

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions