zorchenhimer / MoviePolls

Voting to decide on a movie to watch with MovieNight
https://discord.gg/F2VSgjJ
17 stars 6 forks source link

Add maxlength indicator to Add Movie inputs #133

Closed riddlew closed 2 years ago

riddlew commented 2 years ago

Adds maxlength indicator to form input fields in the Add Movies page that tracks current / maxlength of specific input fields.

This also adds a maxlength indicator to the Reference Links textarea that tracks the current / maxlength of each individual link in the textarea, separated by a newline.

Currently only used in add-movies, but can be added where needed.

This should close #103.

CptPie commented 2 years ago

image adding a picture for zorch :P

riddlew commented 2 years ago

I did not add maxlength to the links fields since they are 500 characters per link, not 500 characters total. Adding maxlength will restrict the field to 500 characters total, as seen in this image: Screenshot from 2022-10-17 17-21-49

Probably wouldn't be an issue if the user doesn't submit more than 2-3 links, but I'd rather not do that considering some animes and mangas have ridiculously long names. What I opted to do was to not restrict the total length of the field, but show a visual indication of when it is over the length. Screenshot from 2022-10-17 17-23-43

If the user still submits even though it is over, it returns the error server side. Screenshot from 2022-10-17 17-23-56

But if each link is under 500, it'll submit successfully. Screenshot from 2022-10-17 17-24-29

CptPie commented 2 years ago

Fair enough, i completely forgot about this (even though i am pretty sure i wrote that part of the logic myself lmao). Closed and merged - ty again :)