Skip to content

( android )TextInput contains Image and Text, Text can't display while Image at first position #16690

@wo883721

Description

@wo883721

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions