Live data from Hacker News

Text exceeding maxlength will no longer be truncated when pasted in Firefox 77

fxsitecompat.dev

41–50 of 145 posts

Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77

#41
post #15

Why would you have a maxlength on password in the first place?!

It's common in practice even if it shouldn't be. Also many bcrypt implementations truncate input longer than 72 characters.

You can also trivially truncate to 72 bytes server side.

Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77

#42
post #25

Earlier 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…

At the risk of stating the obvious, and sorry if so: doing input length validation client side is very useful for the user's experience, but the server should always validate this too. "... now suddenly I have to revisit everything and add JavaScript magic to check form validity ..." sounds suspiciously like you were relying on client side form validation without server validation, I hope that's not the case. :)

Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77

#43
Highlights from the bug report[1][2]:

  - HTML spec allows it; says MAY, not MUST [3]
  - Affects only user pastes, not javascript edits
  - Affects all input boxes, not just password ones
  - New preference editor.truncate_user_pastes can restore old behavior
As a developer, I personally find the inconsistent behavior of maxLength unintuitive and am surprised a potentially-breaking change like this didn't have more discussion (although, the original bug report was open for 4 years). But as a user, I have some empathy for the team's desire to fix "broken" websites (e.g. where the login page has a shorter limit than the account creation page or backend).

[1] https://phabricator.services.mozilla.com/D71689

[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1320229

[3] https://html.spec.whatwg.org/multipage/form-control-infrastr...

Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77

#44

Earlier quoted context omitted.

I'm curious, could you describe the usecase?

I have used password-store (pass) to generate passwords and paste them to forms without realizing they were truncated and simultaneously those sites don't have the same maxlength on their login form.

Ah. On first read, I assumed you meant you had a webapp which was broken by these changes.

Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77

#46

> 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…

https://html.spec.whatwg.org/multipage/forms.html#client-sid...

Your link says to use the very attribute that Mozilla are breaking in this change. Can you explain whatever point you're trying to make?

Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77

#48

Earlier quoted context omitted.

One breaks the expectations of users, the other breaks the expectations of developers. On a website full of developers you'll probably see a lot more from one side than from the other.

I'm pretty sure being able to input text longer than the maximum allowable text into a field breaks user's expectations too. Users don't "win" because you made how a site works more confusing. Their justification for this change is the only user-win (password truncation), and they could have trivially restricted this to passwords then body is hurt.

Users don't expect the length limit! that info isnt presented to them until the text is over-long and the clue is: Surprise! Truncate w/o warning. On more than just password fields.

Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77

#49
post #15

Why would you have a maxlength on password in the first place?!

...I think it's reasonable for there to be some limit, right? Lest a user submit a 50,000 character password?

You haven't answered the question.

> Lest a user submit a 50,000 character password?

What's wrong with that?

Re: Text exceeding maxlength will no longer be truncated when pasted in Firefox 77

#50

Earlier quoted context omitted.

You just typed your comment into a

So Mozilla's non-standard compliant change broke one fewer site, problem solved? 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.

I’ve had issues pasting phone numbers into text fields, where the last digits get cut off because the form doesn’t want hyphens. I’d rather it paste in the full thing and then let me manually remove the hyphens/spaces.
Post reply on HN