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

[bug] Links broken when inserted into Community contact fields (case-sensitive error) #1256

Closed
shenoa opened this issue Nov 7, 2021 · 2 comments

Comments

@shenoa
Copy link

shenoa commented Nov 7, 2021

Describe the bug
When editing the "Contacts and links" section of the https://community.preciousplastic.com/settings page, one of the options is to add a link type called Discord. Any link that is pasted into the text field is reformatted as all lower-case. Any URL that has uppercase letters in the URL is reformatted as lowercase. It is also not possible to type an uppercase letter into the box. This will break any URL that has uppercase letters after the domain. Discord invite links, for example.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Edit Profile'
  2. Scroll down to 'Infos'
  3. Click 'add link'
  4. Type any address with an uppercase letter and it's inserted as lowercase
@thisislawatts
Copy link
Collaborator

Thanks so much for taking the time to file your bug report @shenoa, it is really appreciated ✨

It looks like this is the cause:
https://github.com/ONEARMY/community-platform/blob/master/src/pages/Settings/content/formSections/Fields/Link.field.tsx#L50

I think this should be removed entirely in favour of deferring to the user to format a URL correctly. Browsers are fairly tolerate of malformed hostnames, eg. https://EXAMPLE.com

@thisislawatts thisislawatts self-assigned this Dec 19, 2021
thisislawatts added a commit that referenced this issue Dec 20, 2021
fix: formatting of URL, closes #1256
@thisislawatts
Copy link
Collaborator

🎉 This issue has been resolved in version 1.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

patrycjapraczyk pushed a commit to patrycjapraczyk/community-platform that referenced this issue Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants