-
Bug
-
Resolution: Done
-
Minor
-
None
-
3.9.3, 3.10, 3.11, 4.0
-
None
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
-
MDL-70395-master -
Data privacy add_category and add_purpose modules are using ModalFactory as follows:
trigger.on('click', function() {
|
return this.strings.then(function(strings) {
|
ModalFactory.create({
|
type: ModalFactory.types.SAVE_CANCEL,
|
title: strings[0],
|
body: '',
|
}, trigger).done(function(modal) {
|
this.setupFormModal(modal, strings[1]);
|
}.bind(this));
|
}.bind(this))
|
.fail(Notification.exception);
|
}.bind(this));
|
This results in interesting scenario. First, on click, modal is created, but notice that trigger element passed as second param. ModalFactory is using it to hook up 'activate' event on it. So once modal is shown, suppose user clicks "cancel" - this destroys modal, but this new event hook remains in place. Clicking on trigger element again results in two modals opened one above the other, you can only close top one by clicking cancel, destory event does not seem attached to underlying one.
While use of ModalFactory does not seem correct in this case (no need to pass trigger parameter like it used in many other places, unless you initialising it for partcular element action, not as result of action), this is not reproducable in 3.8. I can't see clearly where regression might came from.
- will be (partly) resolved by
-
MDL-70352 Modal forms stay on the screen if you have multiple modals on one page
-
- Closed
-