-
Bug
-
Resolution: Fixed
-
Minor
-
4.0.6, 4.1.1, 4.2
-
HQ 2023 Sprint i1.2 Moppies
In core/modal module, the close icon executes this.hide() instead of check
this.removeOnClose to execute hide or destroy depending on the value. However, the "esc" key to close the modal does it. The behaviour should be consistent, otherwise opening a modal leaves unwanted HTML in the page depending on how the modal is closed.
Steps to reproduce: # Open a course in edit mode
- In the browser inspector, find ".modal" returns zero results.
- Open an activity dropdown and click on the move option
- In the browser inspector, find ".modal" returns 1 result.
- Click on the modal title to return the focus to the page and press "esc" to close the modal
- In the browser inspector, find ".modal" returns zero results.
- Open an activity dropdown again and click on the move option
- Close the modal with the X button
- Expected: In the browser inspector, find ".modal" should return zero results.
- What happens: In the browser inspector, find ".modal" returns 1 result.
Technical shaping
The error is located in the core/modal module in the registerEventListeners method.
In modal.js #827 the keydown event is clearly checking the remove on close value while in modal.js #856 ignores it and executes hide directly.
- Discovered while testing
-
MDL-76893 Course bulk edit: add bulk activity move action
- Closed