chore(clerk-js): Allow single-character usernames in <UserProfile /> validation#4243
Conversation
🦋 Changeset detectedLatest commit: 772f2a4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
||
| const canSubmit = | ||
| (isUsernameRequired ? usernameField.value.length > 1 : true) && user.username !== usernameField.value; | ||
| const canSubmit = user.username !== usernameField.value; |
There was a problem hiding this comment.
❓ It seems like we have the userSettings available and thus the username min and max length. Is it possible to use them on the client side validation in place of the hardcoded value?
There was a problem hiding this comment.
@nikospapcom I don't see why this change improves things.
Currently we want to disable the button, and don't let you submit if you don't have a value in the field or the value that you matches your current username.
There was a problem hiding this comment.
Maybe only changing usernameField.value.length > 0 is enough ?
|
|
||
| const canSubmit = | ||
| (isUsernameRequired ? usernameField.value.length > 1 : true) && user.username !== usernameField.value; | ||
| const canSubmit = user.username !== usernameField.value; |
There was a problem hiding this comment.
@nikospapcom I don't see why this change improves things.
Currently we want to disable the button, and don't let you submit if you don't have a value in the field or the value that you matches your current username.
670d0c5 to
772f2a4
Compare
<UserProfile /> username field<UserProfile /> validation

Description
In this pr we are allowing single-character usernames in
<UserProfile />validationChecklist
npm testruns as expected.npm run buildruns as expected.Type of change