- Replace .form-inline Bootstrap helper class with .d-flex.flex-wrap.align-items-center
- Refactor .form-inline occurrences in SCSS files or remove when unneeded
- Replace .form-group Boostrap helper class with .mb-3. The .form-group class was only
adding margin bottom styles, so it is an straightforward change.
- Replace .form-group references in SCSS files with .fitem now .form-group has been removed.
- There were some other .form-group occurrences in the code that were using it not for styling
but incorrectly for managing some logic. These have been also replaced with .fitem or removed.
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing
All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.
Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
The datepicker is not keyboard accessible when in a modal.
As we are using yui datepicker and the change is not simple, I added aria-hidden and tabindex properties to avoid screenreaders.
Most types of form field will now include aria-required="true" if the
field is marked as required. This causes assistive technology to inform
users that the field is required.
Before this change, in some cases (e.g. screen reader users tabbing
through fields) users were not informed that a field is required.
The ERROR event is defined as being fired if an exception occurs while
contacting the server. This change ensures it is fired for exceptions
in the form definition AJAX request, not just form submission.
Additionally, if such an error occurs in submission, the form buttons
were left in disabled state. This change makes them enabled again.
We should not rely solely on the provided size information.
Therefore the system needs to recalculate the size of each file in the zip file,
whether small or big.
The changes also cover the filemanager.js file if an error appears.
This is consistent with the API used for other form element types,
in order to provide screen-readable text in the fieldset legend while
not necessarily wanting to display said label.
The new class property is automatically exported to the template via
the `templatable_form_element` trait.
The new quick form field uses a choice list to display a dropdown
component inside a form. Apart from que quick form code, the patch also
include a small improvement to the choicelist class to disable empty
values. This small patch is needed because the quickform field won't
allow empty values.
Preserve existing `enhance` method return of jQuery style promises to
allow calling code to continue relying on that (e.g. when calling old
style `.done` and `.fail`).
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
- Preserve autocomplete input options classes to the autocomplete suggestions
- Add new styles for suggestions headings
- Add a new class selector form-autocomplete-input so input can be easily selected
for styling.
Various improvements to make the module more re-usable elsewhere:
change event bubbling, promise argument support when enhancing.
Co-authored-by: Paul Holden <paulh@moodle.com>
If `moduleName` param is passed in config object for modalform, it will be
used to instantiate modal class, otherwise 'core/modal_save_cancel' is
used.
Co-authored-by: Marina Glancy <marina@moodle.com>
This works the same as the customclassoverride on the submit element,
in that only the 'btn' class is hard coded in the template. Passing
$options['customclassoverride'] to the constructor allows calling code
to specify other classes to be added beside 'btn'. E.g. 'btn-primary'.
If no options array is passed, 'btn-secondary' is used (the existing
class used for button elements).
Read-only forms do not belong to a <form> element, so we can't refer
to that. Instead find the `.mform` element (which exists for regular
and read-only forms).