Skip to content

Conversation

JustinBenito
Copy link
Contributor

…pted.

Users mistakenly enter space which strikes an error, to stop this, entering space is ignored and not included, instead of throwing an error.

Proposed Changes

Related Issues (if applicable)

Please check that the PR fulfills these requirements

  • Set a 100 character limit in your editor/IDE to avoid white space diffs in the PR
  • Tests for the changes have been added (for bug fixes / features)
  • Added yourself to AUTHORS.md

…pted.

Users mistakenly enter space which strikes an error, to stop this, entering space is ignored and not included, instead of throwing an error.
},
inputFormatters: [FilteringTextInputFormatter.deny(new RegExp(r"\s\b|\b\s"))],
onSaved: (value) {
_authData['username'] = value!;
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps it would be better to just trim the whitespaces when saving to _authdata?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes It would be better , but What happens is when we enter a whitespace the regexp catches it and throws an error, Normal People will be frustrated by seeing an Error, It spoils our User Experience, So what we do as a developer is we ignore those mistakes made by the users, That is what most important in UX, So inorder to improve our UX(User Experience) we must ignore the mistake and not throw an error.

Copy link
Member

Choose a reason for hiding this comment

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

yeah I meant instead of the regex, there might be some corner cases where the user only enters white spaces or somthing like that but we can probably live with that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this is a valid PR and I get a hactober-accepted label ;)

@rolandgeider rolandgeider merged commit 4b4ba67 into wger-project:master Oct 5, 2022
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