Why would you have a maxlength on password in the first place?!
Text exceeding maxlength will no longer be truncated when pasted in Firefox 77
21–30 of 145 posts
Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77
#22Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77
#23Earlier quoted context omitted.
Indeed. I'd suggest a change in this code even if this change in FF hadn't arrived.
I think GP was joking. A far more straightforward way to shorten text to a given length is: const shorten = (text, length) => text.substring(0, length);
Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77
#24Earlier quoted context omitted.
A lot of people still put them in forms. They just intercept the form submit to do with as the please. No putting them in a form also breaks accessibility
And a lot of sites don't. "This breaks a ton of things but not everything" isn't a good attitude to browser compatibility, particularly from a browser that already has a small market share. > No putting them in a form also breaks accessibility Nope. Screen readers have no concept of fields, nor any concept of how the piping works below the surface when a is pressed. I run a screen reader every single day.
Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77
#25Earlier quoted context omitted.
And "a password field" also.
That's their justification, not a restriction on the change, this impacts non-password fields too.
I've been setting maxlength to generous values on my fields in applications since I started coding HTML, if now suddenly I have to revisit everything and add JavaScript magic to check form validity where previously the page was completely free of JS, well, I think I'd frankly refuse where possible and tell people to complain to their faulty implementation.
Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77
#26When it comes to password inputs, where you can't necessarily see what you're pasting, it's extremely important than the user knows when truncation occurs. But could that be achieved while still respecting maxlength? Yes, I think it would be decent UX to alert the user when they attempt to paste text that exceeds the maxlength, without actually completing the paste. That way, the input remains empty so there's no confusion about whether the full password or a truncated password has been entered, and the user can take appropriate action.
Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77
#27> The form cannot be submitted until the user fixes the error, so the server shouldn’t receive an excessively long text or password (a server-side validation has to be put in place anyway.) However, this could potentially affect a front-end implementation if it expects the entered text never to exceed maxlength. What century are Mozilla living in? Most, even simple forms, don't use elements and submit buttons anymore…
You just typed your comment into a
Even for this site, why is Mozilla not limiting this breaking change designed to fix password fields to: Password fields. They haven't described why type=text or even textarea should be non-standard, only why type=password should be.
If they limited this to password fields, I'd have no issue. But per the code change they did not.
Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77
#28Earlier quoted context omitted.
That's their justification, not a restriction on the change, this impacts non-password fields too.
Yeah that's the weird thing. They write "for password fields" and then apply it to non-password fields and even multi-line fields. Have you ever seen a multi-line password field?! I understand that people might abuse for it but that's definitely not the common thing and just crazy talk. It's an excuse but I don't understand the reason behind this change. I've been setting maxlength to generous values on my fields in…
Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77
#29> The form cannot be submitted until the user fixes the error, so the server shouldn’t receive an excessively long text or password (a server-side validation has to be put in place anyway.) However, this could potentially affect a front-end implementation if it expects the entered text never to exceed maxlength. What century are Mozilla living in? Most, even simple forms, don't use elements and submit buttons anymore…
If the change really does get bypassed by everyone, that only underlines the sad state of modern website design relying completely on javascript.
I'm not sure why they don't limit this to just passwords but I can imagine it's easier to change the behaviour for all form elements than it is to change the behaviour of just password fields.
Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77
#30Earlier quoted context omitted.
Yeah that's the weird thing. They write "for password fields" and then apply it to non-password fields and even multi-line fields. Have you ever seen a multi-line password field?! I understand that people might abuse for it but that's definitely not the common thing and just crazy talk. It's an excuse but I don't understand the reason behind this change. I've been setting maxlength to generous values on my fields in…
Eh? For what reason you need to add JS? Forms won't submit with overlong text.
Edit: Yes, indeed:
> The form cannot be submitted until the user fixes the error, so the server shouldn’t receive an excessively long text
Thanks for pointing that out!