Live data from Hacker News

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

fxsitecompat.dev

1–10 of 145 posts

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

#4
post #3

This breaks my use case function shorten(text, length) const t = document.createElement('input') t.maxlength = length t.value = text return t.value }

Indeed. I'd suggest a change in this code even if this change in FF hadn't arrived.

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

#7
post #2

I've definitely been bit by this and it definitely took hours to debug

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.

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

#8
post #3

This breaks my use case function shorten(text, length) const t = document.createElement('input') t.maxlength = length t.value = text return t.value }

I know you're joking, but this reminded me of https://xkcd.com/1172/

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

#10
> 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, they're all aJax. Therefore this workaround will be commonly bypassed.

People can debate if this is a good or bad thing, but ultimately the problem remains: This change will cause unexpected behavior when maxlength-ed stuff no longer obeys on thousands of popular websites.

Even if sites check it server-side, that doesn't mean the user experience isn't substantially degraded relative to obeying HTML standards.

Their justification for this change is nonsensical too:

> This change mainly aims at preventing an unexpectedly truncated password from being saved.

So why not limit it to input type=password? Heck why include textareas in this change, who is using a textarea for a password box?!

Post reply on HN