-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
( android )TextInput contains Image and Text, Text can't display while Image at first position #16690
Comments
@facebook-github-bot no-template |
Hey @wo883721, thanks for posting this! It looks like your issue is missing some required information. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce your issue. I am going to close this, but please feel free to open a new issue with the additional information provided. Thanks! |
Hey @facebook-github-bot ,maybe there's something wrong with my description.this bug is all react-native editions. Follow the operation below: create a js file |
@react-native-bot ,The above statement is only a case, I discover When TextInput contains Image, as long as Image move to the first position, these Text node in TextInput can't display,only display image. |
@react-native-bot when Image is not at first position, these FrescoBasedReactTextInlineImageSpans is correct at the mText field that old FrescoBasedReactTextInlineImageSpans is Invalid.But Image is at first position,these FrescoBasedReactTextInlineImageSpans at the mText field has an error occurred. because the Image mapping FrescoBasedReactTextInlineImageSpans start position and end position is not correct. |
@react-native-bot I study react-native for a few months, I like this kind of development. So when I find this bug,I spend a day to debug this bug,but I didn't find the final cause. Only found the wrong places and possible reasons. That's all I can do. |
I have a demand, TextInput contains Image and Text.but I find a bug,when Image at first position, I add Text, Text can't display.
I debugging android source. I find one possible reason. In ReactEditText class, the maybeSetText() function set new content, and call manageSpans method that can reset ReactEditText.getText(). but in this method don't remove FrescoBasedReactTextInlineImageSpan.
if (ForegroundColorSpan.class.isInstance(spans[spanIdx]) ||
BackgroundColorSpan.class.isInstance(spans[spanIdx]) ||
AbsoluteSizeSpan.class.isInstance(spans[spanIdx]) ||
CustomStyleSpan.class.isInstance(spans[spanIdx]) ||
ReactTagSpan.class.isInstance(spans[spanIdx])) {
getText().removeSpan(spans[spanIdx]);
}
So ReactEditText.getText() always contain FrescoBasedReactTextInlineImageSpan, Image coverage text display.How can fix this bug?
Please forgive me for not being fluent in English
The text was updated successfully, but these errors were encountered: