MDL-78885 comboboxesearch: Comboboxes should have a name and value

- core_grades_renderer::group_selector() was changed previously, but it
  was providing redundant context data to
core_group/comboboxsearch/group_selector and on the other hand, it was
not providing 'name' and 'value' for core/comboboxsearch
- The $groupactionbaseurl parameter of
  core_grades_renderer::group_selector() is now deprecated as it was not
used.
- a bug is fixed: if only a lastname initial was set, the clear search
  button was not being displayed.
This commit is contained in:
Shamim Rezaie 2023-10-25 03:17:38 +11:00
parent e9ec450668
commit b4bb1cde97
6 changed files with 70 additions and 32 deletions

View file

@ -17,6 +17,8 @@
Combobox search selector dropdown.
Context variables required for this template:
* name - The name of the input element representing the combobox.
* value - The value of the input element representing the combobox.
* rtl - Is this dropdown being used in a RTL case? if so, we need to ensure it drops down in the right place.
* renderlater - This determines if we show a placeholder whilst fetching content to replace within the placeholder region
* buttoncontent - The string to be shown to users to trigger the dropdown
@ -29,6 +31,8 @@
Example context (json):
{
"name": "input-1",
"value": "0",
"rtl": false,
"renderlater": false,
"usebutton": true,
@ -43,10 +47,7 @@
{{#buttonheader}}
<small>{{.}}</small>
{{/buttonheader}}
<div class="{{#parentclasses}}{{.}}{{/parentclasses}} dropdown"
{{^usebutton}}
data-input-element="input-{{uniqid}}"
{{/usebutton}}>
<div class="{{#parentclasses}}{{.}}{{/parentclasses}} dropdown">
{{#usebutton}}
<div tabindex="0"
@ -57,9 +58,10 @@
aria-controls="dialog-{{instance}}-{{uniqid}}"
class="{{#buttonclasses}}{{.}}{{/buttonclasses}} btn dropdown-toggle keep-open d-flex text-left align-items-center p-0 font-weight-bold"
aria-label="{{#cleanstr}} aria-toggledropdown, core {{/cleanstr}}"
data-input-element="input-{{uniqid}}">
data-input-element="input-{{instance}}-{{uniqid}}">
{{{buttoncontent}}}
</div>
<input type="hidden" name="{{name}}" value="{{value}}" id="input-{{instance}}-{{uniqid}}"/>
{{/usebutton}}
{{^usebutton}}{{{buttoncontent}}}{{/usebutton}}