Skip to content

String text passed in as a value in <textarea> does not seem to be supported with react-linkify #117

@BrianHHough

Description

@BrianHHough

Hi Linkify! LOVE your SDK by the way 🔥

I'm trying to take in a text area and then identify handles or hashtags or links in the <textarea>. I can do this 100% with Div's, strings, etc. but for some reason, Linkify won't recognize the actual text inside of the <textarea> to put links to it.

Is there a way to use the {children} module of Linkify to then ID the text inside of a child component and then Linkify that?

Any help understanding how to do this would be really appreciated!

Thank you!

My attempted code:

var text = "Hey there I'm a text posted by: @user1 \n #newPosterHere \n https://thisisawebsitethatshouldbelinked.com"

<Linkify
        componentDecorator={textareaDecorator}
        matchDecorator={matchDecoratorTextArea}
      >
   <textarea
          id="textarea"
          fontSize="15px"
          lineHeight="25px"
          readOnly
          name="textarea"
          value={text}
          style={{
            width: "400px",
            height: "100px"
          }}
        >
   </textarea>
</Linkify>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions