-
-
Notifications
You must be signed in to change notification settings - Fork 71
Description
From #945: when this is fixed, update these meta posts:
https://meta.codidact.com/posts/287128
https://meta.codidact.com/posts/287130
Describe the bug
Some markdown editors on the site have a 30 character minimum. This may not be desirable in some cases.
To Reproduce
- Go to: /users/edit/profile
- Edit "Profile" bio text to have < 30 characters.
- Save button is disabled.
Expected behavior
I was expecting either:
- A helpful error message stating the 30 character minimum or
- To be able to have a bio with < 30 characters.
Instead the "Save" button was disabled silently.
Environment
- OS: macOS Monterey
- Browser: Chromium
- Version: 103.0.5060.53
- OS: Slackware Linux 15
- Browser: Firefox
- Version: 102.12.0esr
- OS: Windows 10
- Browser: Chrome
- Version: 114.0.5735.198
Additional context
While I have no experience with Ruby On Rails, it seems like this is caused by the following:
- Line 40: /app/views/users/edit_profile.html.erb uses
shared/body_field - Line 25: /app/views/shared/_body_field.html.erb uses
posts/mdhint - Line 5: /app/views/posts/_mdhint.html.erb specifies
data-min="30"which is enforced by:
This means, changing data-min via Inspect Element will bypass this limit for "Edit Profile" since it is not enforced server side (however it seems like it is for posts?)
Changing data-min="30" in mdhint will affect:
- /app/views/tour/question2.html.erb
- /app/views/admin/all_email.html.erb
- /app/views/mod_warning/new.html.erb
- /app/views/tags/_form.html.erb
- /app/views/posts/_form.html.erb
Perhaps, body_field & mdhint could accept min & max with default values set at 30?