-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Implement char counter for input field, too #35678
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
[4.0] Implement char counter for input field, too #35678
Conversation
|
Could this option be added to the custom fields as well? |
Co-authored-by: Richard Fath <[email protected]>
In theory, it could be added to any (input/textarea) field. Currently I activate it manually in my override via: But that's currently a "bigger" problem in Joomla! (in my opinion): we use for every field an unique layout (which is good on one side) but therefore are very inconsistent over all (like the suffix/prefix info are only available for normal text fields and not for e.g. number fields etc.). |
That is a bug that should be fixed ;) |
Yes and no, it's failure by design :) the number field does not extend the text field and the layouts could be one base layout with just different attributes....But I guess this counts for many fields (like all dropdowns etc.) |
or by omission |
|
I have tested this item ✅ successfully on 97294eb This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35678. |
|
@bembelimen I wouldn't enable that before fixing the counter to work nicely for repeatable fields. BTW the project should review the fields compatibility with repeatable fields and patch what's broken (ie a field with a counter in a repeatable will work only for the first instance, all others will miss the counter because there's no event to trigger the initialization...) |
|
Hi @dgrammatiko do you mean this PR (as the problem is the same with textareas then) or the spreading over all fields? |
Yes, the initialization of that script is missing the listener for subform add/removal part
There are many core fields that have issues or not working at all in subforms. Some are easy to patch (ie this one) others need some more changes |
|
it will be more of an issue with this field - and I see an issue whereby the capabilities of a custom field are not in sync with an xml field. I agree that all fields need to be reviewed with subforms - there are already a few open issues but thats beyond the scope here (I think) |
Probably the repeatable versions of |
I just checked. Suffix and Prefix are available for every field - it is in the render options |
|
I have tested this item ✅ successfully on 97294eb This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35678. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35678. |
|
@richard67 my comment is still valid, introducing this without support for repeatable fields is plain wrong 😑 |
@dgrammatiko Sorry, was not clear to me that there is something remaining to be done since the PR has got 2 test. @bembelimen What's the status of this PR? You want to leave it as it is, or do you want to adapt it to support repeatable fields? |
|
Back to pending due to ongoing clarifications. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35678. |
|
Needs review. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35678. |
|
Hi! just using the brand new charcounter param in my edit message form like this Is it possible to apply this to the text input? Thanks! This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35678. |
@mgscreativa Isn't that exactly what this pull request (PR) here here is doing? If so, please test this PR and then mark your test result by going to the issue tracker here https://issues.joomla.org/tracker/joomla-cms/35678 and then using the blue "Test this" button at the top left corner, selecting the appropriate test result and submitting. Every PR needs 2 successful tests by a human to get accepted, so if this PR solves your problem then please test it as described to bring it forward. Thanks in advance. |
|
I have tested this item ✅ successfully on ae922dc This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35678. |
|
Hi @richard67 done testing, works ok! Hope it gets in J 4.1 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35678. |
mgscreativa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works just fine!
|
@bembelimen After building I get the error: Uncaught SyntaxError: missing ) after argument list (at short-and-sweet.min.js?1.0.4:10:104) |
Previous review comment already mentioned that. There is indeed a syntax error in the js. The closing single quote of a query selector string is missing. |
|
Hi! is there anything else I can do to helpo this PR to pass? I'm using it in my site and it works just fine. Thanks! |
|
As long as @bembelimen does not fix the syntax error in the JS mentioned above, it can not be accepted. |
|
Hi @richard67 can I send another PR with the same changes to try to pass it through? |
|
Hi! @bembelimen would yo be so kind to review this typo here to be able to pass this PR? https://github.com/joomla/joomla-cms/pull/35678/files#r926994733 Thanks! |
|
Hi @richard67 Can I send a fresh new PR to pass this new feature? Because the original PR author doesn't respond at all... |
@mgscreativa Let's wait a bit more. I've just notified him again. |
|
I have tested this item ✅ successfully on e13df24 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35678. |
1 similar comment
|
I have tested this item ✅ successfully on e13df24 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35678. |
|
Thank you Benjamin @bembelimen! |
|
Documentation found under https://docs.joomla.org/Text_form_field_type |


Summary of Changes
Enabled character counter for text fields
Testing Instructions
maxlength="30" charcounter="true"Actual result BEFORE applying this Pull Request
Nothing different
Expected result AFTER applying this Pull Request