app icon indicating copy to clipboard operation
app copied to clipboard

Bug: Can keep typing in the bio field of user settings after 255 characters

Open nickytonline opened this issue 1 year ago • 10 comments

We currently display a message saying the bio is too long in the user settings, but we're not leveraging the native maxLength HTML attribute to prevent someone from typing past the limit.

CleanShot 2024-02-07 at 08 15 24

As well, since maxLength prevents you from typing or pasting text past 255 characters, the bio too long message will actually never appear so it can be removed from the component.

This is what happens when maxLength="255" is set.

CleanShot 2024-02-07 at 08 08 43

nickytonline avatar Feb 07 '24 13:02 nickytonline

Thanks for the issue, our team will look into it as soon as possible! If you would like to work on this issue, please wait for us to decide if it's ready. The issue will be ready to work on once we remove the "needs triage" label.

To claim an issue that does not have the "needs triage" label, please leave a comment that says ".take". If you have any questions, please reach out to us on Discord or follow up on the issue itself.

For full info on how to contribute, please check out our contributors guide.

github-actions[bot] avatar Feb 07 '24 13:02 github-actions[bot]

The file to change is https://github.com/open-sauced/app/blob/3d157ab69ae34353ec169f6c6cbd12744c199a98/components/organisms/UserSettingsPage/user-settings-page.tsx#L273-L298

Here's what needs to be done to fix this

            {/* Bio section */}
            <div className="flex flex-col gap-2">
              <label className="flex flex-col w-full text-sm">
                Bio
                <div className="flex-1 px-2 shadow-input border transition rounded-lg py-1 flex items-center bg-light-slate-4 disabled:cursor-not-allowed focus-within:border-light-orange-9">
                  <textarea
                    rows={4}
                    placeholder="Tell us about yourself."
                    name="bio"
                    className="w-full focus:outline-none placeholder:font-normal placeholder-slate-400 bg-inherit"
                    value={bio}
+					maxLength={255}
                    onChange={(e) => setBio(e.target.value)}
                  ></textarea>
                </div>
              </label>

-              {bio?.length > 255 ? (
-                <p aria-live="assertive" className="text-light-red-10 text-xs">
-                  Bio too long
-                </p>
-              ) : (
-                <p aria-live="polite" className="text-xs">
-                  {bio?.length}/255
-                </p>
-              )}
+              <p aria-live="polite" className="text-xs">
+                {bio?.length}/255
+              </p>
            </div>

nickytonline avatar Feb 07 '24 13:02 nickytonline

.take

lexlucid avatar Feb 07 '24 15:02 lexlucid

.take

Pagla-Dasu avatar Feb 07 '24 17:02 Pagla-Dasu

Thanks for being interested in this issue. It looks like this ticket is already assigned to a contributor.

github-actions[bot] avatar Feb 07 '24 17:02 github-actions[bot]

.take

unix-unicorn avatar Feb 23 '24 20:02 unix-unicorn

is it still open?

devharsh2k4 avatar May 06 '24 18:05 devharsh2k4

@Pagla-Dasu has been working on this and has a PR up for it. Not sure why they weren't assigned. 🤔

nickytonline avatar May 06 '24 18:05 nickytonline

@nickytonline i have raised a pr if possible could u review

devharsh2k4 avatar May 06 '24 18:05 devharsh2k4

@nickytonline i have raised a pr if possible could u review

@devharsh2k4, it's already assigned to @Pagla-Dasu and they have a PR up for this.

nickytonline avatar May 06 '24 19:05 nickytonline

:tada: This issue has been resolved in version 2.48.1-beta.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

open-sauced[bot] avatar Jul 31 '24 12:07 open-sauced[bot]

:tada: This issue has been resolved in version 2.49.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

open-sauced[bot] avatar Aug 01 '24 20:08 open-sauced[bot]