Skip to content

Conversation

@stevebell117
Copy link

@stevebell117 stevebell117 commented Dec 14, 2020

Whenever a Server URL is copy/pasted (from Discord, for example), it will sometimes add a space to the beginning or end of the URL and fail the URL Validation. This change trims the white space at the beginning and end of the string before verifying the URL.


function onChange(event: React.ChangeEvent<HTMLInputElement>) {
setCurrentURL(event.target.value);
let eventValue = event.target.value.trim();

Choose a reason for hiding this comment

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

since eventValue won't change, I think it should be a const instead of let.

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