User tests: Successful: Unsuccessful:
Enabled character counter for text fields
maxlength="30" charcounter="true"
Nothing different
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Repository Layout Libraries |
Labels |
Added:
?
|
Could this option be added to the custom fields as well?
In theory, it could be added to any (input/textarea) field. Currently I activate it manually in my override via:
$form->setFieldAttribute('fieldname', 'charcounter', 'true', 'com_fields');
and it works "out-of-the-box".
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.).
Probably worth to have there a nicer solution.
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 ;)
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.)
it's failure by design :)
or by omission
I have tested this item
@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?
as the problem is the same with textareas
Yes, the initialization of that script is missing the listener for subform add/removal part
the spreading over all fields?
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)
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.
Probably the repeatable versions of input
and textarea
need also an update to expose this feature (if it's not already exposed, I haven't checked the code, I was commenting on the base that the core fields should play nicely with repeatables).
Anyways I provided the code needed
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.).
I just checked. Suffix and Prefix are available for every field - it is in the render options
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
@richard67 my comment is still valid, introducing this without support for repeatable fields is plain wrong
@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?
Status | Ready to Commit | ⇒ | Pending |
Back to pending due to ongoing clarifications.
Status | Pending | ⇒ | Needs Review |
Needs review.
This pull request has automatically rebased to 4.2-dev.
This pull requests has been automatically converted to the PSR-12 coding standard.
Labels |
Added:
?
?
Removed: ? |
Hi! just using the brand new charcounter param in my edit message form like this
<field
name="title"
type="text"
label="COM_JAPPPUSH_FIELD_MESSAGE_TITLE_LABEL"
maxlength="35"
charcounter="true"
required="true"
/>
<field
name="body"
type="textarea"
label="COM_JAPPPUSH_FIELD_MESSAGE_BODY_LABEL"
maxlength="160"
charcounter="true"
/>
Is it possible to apply this to the text input?
Thanks!
Is it possible to apply this to the text input?
@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
Tested ok, no issues!
Hi @richard67 done testing, works ok! Hope it gets in J 4.1
@bembelimen After building I get the error: Uncaught SyntaxError: missing ) after argument list (at short-and-sweet.min.js?1.0.4:10:104)
Don't know if it is related, but the counter does not show up. Could you take a look?
@bembelimen After building I get the error: Uncaught SyntaxError: missing ) after argument list (at short-and-sweet.min.js?1.0.4:10:104)
Don't know if it is related, but the counter does not show up. Could you take a look?
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!
Labels |
Added:
?
Removed: ? |
Hi @richard67 Can I send a fresh new PR to pass this new feature? Because the original PR author doesn't respond at all...
Hi @richard67 Can I send a fresh new PR to pass this new feature? Because the original PR author doesn't responds at all...
@mgscreativa Let's wait a bit more. I've just notified him again.
Labels |
Added:
PR-4.3-dev
Removed: ? |
I have tested this item
I have tested this item
Status | Needs Review | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-09-24 01:14:28 |
Closed_By | ⇒ | obuisard |
Thank you Benjamin @bembelimen!
Documentation found under https://docs.joomla.org/Text_form_field_type
Could this option be added to the custom fields as well?