-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove maxlength
attribute from textarea
after character count JavaScript has been initialised
#2590
Remove maxlength
attribute from textarea
after character count JavaScript has been initialised
#2590
Conversation
Only saw the big refactor going on over in #2577 after I'd opened this. Might just be something to fold into that? Up to you anyway /shrug |
Great spot @andymantell – thanks! Digging in to the history, it looks like this might have been broken since the component was introduced in #959 as we've always tried to remove the maxlength from the I think originally we had planned to set the character limit using the There was some discussion about the value of removing the I definitely agree that the current code is 'broken' as it doesn't do anything useful, but I am wondering if we should just remove it. As far as I know, the only way to set @andymantell Are you setting |
I've got maxlength set at the moment, because I'm starting building something on 111 online from a no-JS perspective and half figured it was best to have it in there. But I am very open to being convinced that I shouldn't use it at all. Of course I'll still need some serverside validation anyway. So yeah I'm not reliant on it at all - if that's the recommendation, I'm quite happy to drop it from what I'm building and we can close this off. |
Although I guess the purpose of this line of code is still valid - that if someone like myself has added maxlength in for whatever reason (even if that reason is questionable), you really don't want it left in there as it scuppers the character count code. Therefore, you should maybe keep it in? And forcibly remove it from the textarea. |
Thanks for raising this PR @andymantell . A couple of us have had a discussion about this and while I think we're a bit 50/50 on whether to accept the PR and fix the logic or just remove it entirely, the easiest option for us right now would be to fix what this line was originally intended to do. @andymantell are you ok to rebase this PR against the latest changes in |
Am away at the moment but I will do this when I'm back on Tuesday if that's ok. Thanks.
|
…ld not be present
Was being removed from the containing div, but should be removed from the textarea instead.
3ca3db5
to
2ec4c14
Compare
@vanitabarrett This is up to date with main now and conflicts resolved 👍🏻 |
Looks good to me. This just needs to be approved by someone else in the team, and then it can be merged. |
Thanks all 👍🏻 |
maxlength
attribute should not be present on textarea
after character count JavaScript has kicked in
maxlength
attribute should not be present on textarea
after character count JavaScript has kicked inmaxlength
attribute from textarea
after character count JavaScript has kicked in
maxlength
attribute from textarea
after character count JavaScript has kicked inmaxlength
attribute from textarea
after character count JavaScript has been initialised
If a
maxlength
attribute is specified on thetextarea
, this should be removed after the character-count JS has kicked in. At the moment however, the JS is trying to remove the attribute from the wrappingdiv
which does not do anything.