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: Can keep typing in the bio field of user settings after 255 characters #2612

Open
nickytonline opened this issue Feb 7, 2024 · 10 comments · May be fixed by #2615
Open

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

nickytonline opened this issue Feb 7, 2024 · 10 comments · May be fixed by #2615
Assignees
Labels
🐛 bug Something isn't working good first issue Good for newcomers

Comments

@nickytonline
Copy link
Member

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 nickytonline added 🐛 bug Something isn't working 👀 needs triage labels Feb 7, 2024
Copy link

github-actions bot commented Feb 7, 2024

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.

@nickytonline
Copy link
Member Author

The file to change is

{/* 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}
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>
)}
</div>

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 nickytonline added good first issue Good for newcomers and removed 👀 needs triage labels Feb 7, 2024
@lexlucid
Copy link

lexlucid commented Feb 7, 2024

.take

@Pagla-Dasu
Copy link

.take

Copy link

github-actions bot commented Feb 7, 2024

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

Pagla-Dasu added a commit to Pagla-Dasu/app that referenced this issue Feb 7, 2024
…d after 255 characters

(70) Now, it Can't keep typing in the bio field of user settings after 255 characters. Changed the
code in user-sttings-page.tsx

fix open-sauced#2612
@lexlucid lexlucid removed their assignment Feb 7, 2024
@HodaSalim
Copy link

.take

@devharsh2k4
Copy link

is it still open?

@nickytonline
Copy link
Member Author

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

@devharsh2k4
Copy link

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

@nickytonline
Copy link
Member Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants