User tests: Successful: Unsuccessful:
Currently we ignore the hint attribute for List type form field. This PR is to utilize it if provided to add placeholder (as well as data-palceholder for chosen and select2) attributes to the rendered input control.
Create a form field for type list using xml in any component, provide the hint attribute as we do for text type fields. The hint should be visible when no options are selected on the UI.
<field
name="test_list"
type="list"
multiple="true"
hint="Test Hint for multiple"
/>
<field
name="test_list_single"
type="list"
hint="Test Hint for single"
/>
Without this PR, the hint was ignored.
Also test with chosen, select2.
We need to add the information about this attribute (hint) being available in list
field also.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Libraries |
@izharaazmi can you fix the conflicts here too? If ready please ping me for a test
@izharaazmi what about implementing it into https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/form/abstractlist.php ? or do i miss something?
I have tested this item
still works as described
I have tested this item
Placeholder isn't a valid attribute for selects, radios and checboxes to my knowledge. That's why it isn't supported.
Also I see no hint in a HTML select when I add it to a list field (tested with Chrome). In chosen "selects" I can make it appear, but I need to add a stupid empty option to it which then allows the clear the selected value. Only then I will see the hint.
I honestly don't see the point of adding something which isn't supported by the HTML spec.
Placeholder isn't a valid attribute for selects, radios and checboxes
Exactly placeholder is invalid HTML and should be removed and only keep data-placeholder="..."
and then this HTML will be valid
$attr .= !strlen($hint) ? ''
:' placeholder=' . json_encode($hint) . ' data-placeholder=' . json_encode($hint);
data-placeholder, is needed by chosen JS (and select2 JS) to show their typing prompt in
I have tested this item
After this change is applied, when you try to edit an article this notice appears: JGLOBAL_USE_GLOBAL_VALUE_NOT_FOUND
The hint needs to be escaped by using JText::_(..., true) or use json_encode() to when appending it
and also the placeholder=... must be used !
@izharaazmi please review this
If this PR get no Response, it will be closed at 22th June 2017.
can a Maintainer please look whats next with this PR?
Status | Pending | ⇒ | Needs Review |
Closing this as there has been no response. @izharaazmi feel free to reopen this once you have implemented the feedback given. Thank you.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-07-22 19:56:53 |
Closed_By | ⇒ | roland-d |
I have tested this item✅ successfully on 4265d18
works as described
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12447.