mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-68778 user: Fetch select from selected option
It seems that the HTMLSelectElement behaves slightly different on Linux vs MacOS. On Linux with Firefox 47 when selecting an option the HTMLOptionElement is returned, whereas on MavOS the HTMLSelectElement that the Option belongs to is returned. We need to normalise the value here before resetting the currently selected item.
This commit is contained in:
parent
1afe68f382
commit
db5be3a31c
2
user/amd/build/participants.min.js
vendored
2
user/amd/build/participants.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -59,7 +59,8 @@ export const init = ({
|
||||
const registerEventListeners = () => {
|
||||
CustomEvents.define(Selectors.bulkActionSelect, [CustomEvents.events.accessibleChange]);
|
||||
jQuery(Selectors.bulkActionSelect).on(CustomEvents.events.accessibleChange, e => {
|
||||
const action = e.target.value;
|
||||
const bulkActionSelect = e.target.closest('select');
|
||||
const action = bulkActionSelect.value;
|
||||
const tableRoot = getTableFromUniqueId(uniqueid);
|
||||
const checkboxes = tableRoot.querySelectorAll(Selectors.bulkUserSelectedCheckBoxes);
|
||||
|
||||
@ -88,8 +89,7 @@ export const init = ({
|
||||
.then(modal => {
|
||||
modal.getRoot().on(ModalEvents.hidden, () => {
|
||||
// Focus on the action select when the dialog is closed.
|
||||
const bulkActionSelector = root.querySelector(Selectors.bulkActionSelect);
|
||||
bulkActionSelector.focus();
|
||||
bulkActionSelect.focus();
|
||||
});
|
||||
|
||||
return modal;
|
||||
@ -97,10 +97,10 @@ export const init = ({
|
||||
.catch(Notification.exception);
|
||||
}
|
||||
} else if (action !== '' && checkboxes.length) {
|
||||
e.target.form.submit();
|
||||
bulkActionSelect.form.submit();
|
||||
}
|
||||
|
||||
resetBulkAction(e.target);
|
||||
resetBulkAction(bulkActionSelect);
|
||||
});
|
||||
|
||||
root.addEventListener('click', e => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user