Live data from Hacker News

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

fxsitecompat.dev

11–20 of 145 posts

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

#11

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

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

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

#12

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

It's important to use form elements for accessibility even if your submitting another way. Also at least for me its a lot better to use the built in form validation then creating your own.

https://dev.to/addyosmani/accessibility-tips-for-web-develop...

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

#13

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

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

#14
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.

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

#17

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

It's important to use form elements for accessibility even if your submitting another way. Also at least for me its a lot better to use the built in form validation then creating your own. https://dev.to/addyosmani/accessibility-tips-for-web-develop...

Your link doesn't support your statement, or even attempt to. Screen readers have no concept of elements, nor do they differentiate on what happens behind the curtain when a button is pressed (e.g. aJax Vs. submit).

If you have an article that does explain your argument, please link it.

> Also at least for me its a lot better to use the built in form validation then creating your own.

This change removes that very validation.

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

#19

> 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
Post reply on HN