meliorence / react-native-render-html

iOS/Android pure javascript react-native component that renders your HTML into 100% native views
https://meliorence.github.io/react-native-render-html/
BSD 2-Clause "Simplified" License
3.48k stars 589 forks source link

Text in not highlighted when copying in iOS #523

Closed bipin-sakariya closed 3 years ago

bipin-sakariya commented 3 years ago

Decision Table

Good Faith Declaration

Description

When i try to copy text in iOS devices text is copying but it is not highlighted. i already set textSelectable={true}.

Screenshot 2021-09-24 at 4 10 26 PM

I try to implement this library [https://github.com/Astrocoders/react-native-selectable-text#react-native-selectable-text] and used inside render-html library HTML.js file (react-native-render-html/src/HTML.js) but it is not working. when i used react-native-selectable-text library out side render-html library it is working fine.

React Native Information

System:
    OS: macOS 10.15.7
  Binaries:
    Node: 16.8.0
    npm: 7.21.0
  IDEs:
    Android Studio: Android Studio Arctic Fox | 2020.3.1 Patch 1
    Xcode: 12.4 (12D4e)

RNRH Version

RN : 0.62.2 RNRH : ^5.0.0-alpha.2

Tested Platforms

Reproduction Platforms

Minimal, Reproducible Example

I try to implement this library [https://github.com/Astrocoders/react-native-selectable-text#react-native-selectable-text] and used inside render-html library HTML.js file (react-native-render-html/src/HTML.js) but it is not working. when i used react-native-selectable-text library out side render-html library it is working fine.

<SelectableText
                    menuItems={["Copy", "Paste"]}
                    onSelection={({ eventType, content, selectionStart, selectionEnd }) => {
                        Clipboard.setString(content)
                    }}
                    TextComponent={() => <Text>Lorem ipsum dolor sit amet, consectetur
                        adipiscing elit, sed do eiusmod tempor incididunt ut labore et
                        dolore magna aliqua.Ut enim ad minim veniam, quisnostrud exercitation
                        ullamco laboris nisi ut aliquipex ea commodo consequat.</Text>
                    }
                />

Additional Notes

No response

jsamr commented 3 years ago

@bipin-sakariya Hi, and thanks for your submission and your efforts!

A few remarks:

Unfortunately, for all the above-mentioned reasons, I can't do much about this and I am going to close this issue. You are always welcomed to ask for help in our discord channel :-)

ansmlc commented 2 years ago

I have the same issue.

Added defaultTextProps={{selectable:true}} but that only enabled copying of the entire text, and no way to select text.

To reproduce: Use react-native-render-html on iOS.

armin23615 commented 1 year ago

Same issue on version 6.3.4.

mlembke1 commented 1 year ago

@jsamr , how could you close so many issues that are bringing up the same problem? I understand that you all have requirements about how an issue is brought up. But, the point of the those requirements is to weed out false positives and to present the issue clearly to you. This issue has been presented clearly that selecting text in IOS doesn't work even with selectable: true.

We love this package. Great work and all that. Please work on this!

jsamr commented 1 year ago

how could you (...) Please work on this!

I'm going to immediately push back on this kind of tone in the OS space. I hope everyone understands that an open-source contributor works voluntarily for the good of the community. Would you ask someone working in an NGO cleaning up beaches while taking a walk, "hey, how dare you ignore that! Look at this junk, please work on this!"? You are part of this OS community, you can take this piece of junk and put it in a bin, this repo is very open to contributions.

the point of the those requirements is to weed out false positives and to present the issue clearly to you

I get to decide what the point of those requirements are, since I designed these. These requirements are set to save precious time by asking for a full reproduction.

As of this peculiar reporting, it used a third-party library; I'm not willing to investigate third-party integrations unless I find a compelling reason to do so.

Now to get to the problem at stake, and assuming this is the problem you encountered, it seems to be a bug with React Native rendering nested Text elements on iOS. Quick repro here: https://snack.expo.dev/@jsamr/text-fails-to-be-selectable-on-ios You are welcome to report this bug to the official RN repo: https://github.com/facebook/react-native/issues/new/choose

mlembke1 commented 1 year ago

@jsamr , I think you have some fair points. But, I don't think it was fair for you to characterize my comment and question as a having some kind of degrading tone. I specifically said we love your package and you've put in good work.

You are obviously correct that you decide what the point of those requirements are. I posted my comment to challenge your definition, given there have been many people who have brought this up. And remember, just because someone asks you how you "could close so many issues?" doesn't mean that they think your work is trash or that you have ignored them. It is was a legitimate question.

Because of your response to the question (in your last paragraph), I can now see why this issue should be closed and all related issues, because it doesn't have to do with your library! Thank you 👍 All the best, Mitch

jsamr commented 1 year ago

@mlembke1 Sorry if I misinterpreted the tone and intention. Appreciate the clarification!

jsamr commented 1 year ago

@mlembke1

I don't think it was fair for you to characterize my comment and question as a having some kind of degrading tone

I didn't exactly see it that way, communicating online can be hard. But definitely "How could you ... please fix it" is not IMO the best way to engage, it may sound imperative to some ears, as in "you OS contributor owe the community some work", that is what triggered my response.

mlembke1 commented 1 year ago

@jsamr you're definitely right about communicating online.

I could have been more clear for sure. Thanks for your understanding.