PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar HLeithner
HLeithner
21 Jan 2026

Summary of Changes

Allow to add class attribute and additional attributes to select.groupedlist htmlhelper.
This allows the optgroup the same attributes like select.options

Testing Instructions

create a HTMLHelper::_('select.groupedlist'); which includes group.class and group.attr entries.

Example:

$data = [];
$data[0]['items'][''] = Text::_('JSELECT');
$data['group1'] = [
  'label' => 'I'm group 1',
  'items' => [
    'value1' => 'text1',
    'value2' => 'text2',
  ]
  'class' => 'niceclass',
  'attr' => 'data-additional="information"'
];

echo \Joomla\CMS\HTML\HTMLHelper::_('select.groupedlist', $data, 'testname' , [
  'group.items' => 'items',
  'group.label' => 'label',
  'group.class' => 'class',
]);

Actual result BEFORE applying this Pull Request

<select name="testname">
  <option value="" selected="selected">Auswählen</option>
  <optgroup label="I am group 1">
    <option value="value1">text1</option>
    <option value="value2">text2</option>
  </optgroup>
</select>

Expected result AFTER applying this Pull Request

<select name="testname">
  <option value="" selected="selected">Auswählen</option>
  <optgroup label="I am group 1" class="niceclass" data-additional="information">
    <option value="value1">text1</option>
    <option value="value2">text2</option>
  </optgroup>
</select>

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar HLeithner HLeithner - open - 21 Jan 2026
avatar HLeithner HLeithner - change - 21 Jan 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Jan 2026
Category Libraries
5dd1b89 21 Jan 2026 avatar HLeithner cs
avatar HLeithner HLeithner - change - 21 Jan 2026
Labels Added: PR-6.1-dev
avatar dgrammatiko
dgrammatiko - comment - 26 Jan 2026

@HLeithner although this is nice enhancement it falls quite sort for the upcoming (already available in the chromium supported browsers) <select> changes:
Docs: whatwg/html#10548

Video: https://www.youtube.com/shorts/6yFm0BLI2hk

avatar HLeithner
HLeithner - comment - 27 Jan 2026

I like it @dgrammatiko but I think we are not there yet https://caniuse.com/selectlist (all read and behind feature flag) since 2022.

Anyway we would need another approach for this kind of customization, maybe finally a layout for the htmlhelper.select.xxx but I think we will not be the first supporting this ;-)

avatar VaishnaviSidral VaishnaviSidral - test_item - 30 Jan 2026 - Tested successfully
avatar VaishnaviSidral
VaishnaviSidral - comment - 30 Jan 2026

I have tested this item ✅ successfully on 5dd1b89

I tested this issue, and it was tested successfully.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46739.

avatar nadjak77 nadjak77 - test_item - 31 Jan 2026 - Tested successfully
avatar nadjak77
nadjak77 - comment - 31 Jan 2026

I have tested this item ✅ successfully on 5dd1b89

There are two faults in the example data:

avatar hamby hamby - test_item - 31 Jan 2026 - Tested successfully
avatar hamby
hamby - comment - 31 Jan 2026

I have tested this item ✅ successfully on 5dd1b89


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46739.

Add a Comment

Login with GitHub to post a comment