Skip to content
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

Discussion thread links #4483

Merged
merged 7 commits into from
Jan 7, 2021
Merged

Discussion thread links #4483

merged 7 commits into from
Jan 7, 2021

Conversation

nickoferrall
Copy link
Contributor

This PR resolves issue #4345.

Consideration

Copying and pasting between Draft JS editors doesn't work very well - font styles and hyperlinks aren't always maintained. This is a known issue in Draft JS. Someone from the community has created a PR with a suggested solution that hasn't been approved but I'd be happy to look into it.

However, I can't imagine that many of our users are copying & pasting text that they've just pasted so I suggest that I create an issue for this and prioritise it if any user tension pops up.

AC

  • Users can paste links into the comment editor
  • Users can paste links into the task editor
  • Users can paste a combination of text and hyperlinks and the hyperlinks will still work

@@ -164,6 +166,15 @@ const CommentEditor = (props: Props) => {
}
}
}
const links = linkify.match(text)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I included this code in useLinks to keep things DRY but as it's only being repeated twice and as we need the above onPasteText code with the ref in this file, I felt it'd be best to keep it in the same function

@mattkrick
Copy link
Member

this isn't working for me:

  1. in a thread, add a comment & type http://www.google.com
  2. hit space, see it turn into a hyperlink, copy the text
  3. submit
  4. hit ctrl+v to add a second, duplicate comment
  5. clicking the first comment works as a hyperlink, but the 2nd does not

@nickoferrall
Copy link
Contributor Author

Interesting - I couldn't replicate that behaviour in the comment editor but if I followed steps 1-3 and then did ctrl+v into the task editor, the link was underlined but didn't work.

I'm now trimming the whitespace which has resolved the task editor issue and I think it should resolve the comment editor issue too.

@mattkrick
Copy link
Member

success!

@mattkrick mattkrick merged commit ab07925 into master Jan 7, 2021
@mattkrick mattkrick deleted the discussion-thread-hyperlinks branch January 7, 2021 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants