diff --git a/src/addon/mod/assign/pages/edit-feedback-modal/edit-feedback-modal.html b/src/addon/mod/assign/pages/edit-feedback-modal/edit-feedback-modal.html index f14e45d80..862f4cf47 100644 --- a/src/addon/mod/assign/pages/edit-feedback-modal/edit-feedback-modal.html +++ b/src/addon/mod/assign/pages/edit-feedback-modal/edit-feedback-modal.html @@ -11,6 +11,6 @@
- +
diff --git a/src/addon/mod/assign/pages/edit-feedback-modal/edit-feedback-modal.ts b/src/addon/mod/assign/pages/edit-feedback-modal/edit-feedback-modal.ts index 01b24e5de..08f2369bb 100644 --- a/src/addon/mod/assign/pages/edit-feedback-modal/edit-feedback-modal.ts +++ b/src/addon/mod/assign/pages/edit-feedback-modal/edit-feedback-modal.ts @@ -72,8 +72,13 @@ export class AddonModAssignEditFeedbackModalPage { /** * Done editing. + * + * @param {Event} e Click event. */ - done(): void { + done(e: Event): void { + e.preventDefault(); + e.stopPropagation(); + // Close the modal, sending the input data. this.forceLeave = true; this.closeModal(this.getInputData()); diff --git a/src/addon/mod/data/pages/edit/edit.html b/src/addon/mod/data/pages/edit/edit.html index 7f34748e7..8dc29855f 100644 --- a/src/addon/mod/data/pages/edit/edit.html +++ b/src/addon/mod/data/pages/edit/edit.html @@ -23,7 +23,7 @@ {{ cssTemplate }} -
+
diff --git a/src/addon/mod/data/pages/edit/edit.ts b/src/addon/mod/data/pages/edit/edit.ts index c311a7137..51de16b22 100644 --- a/src/addon/mod/data/pages/edit/edit.ts +++ b/src/addon/mod/data/pages/edit/edit.ts @@ -185,9 +185,13 @@ export class AddonModDataEditPage { /** * Saves data. * + * @param {Event} e Event. * @return {Promise} Resolved when done. */ - save(): Promise { + save(e: Event): Promise { + e.preventDefault(); + e.stopPropagation(); + const inputData = this.editForm.value; return this.dataHelper.hasEditDataChanged(inputData, this.fieldsArray, this.data.id, diff --git a/src/addon/mod/data/pages/search/search.html b/src/addon/mod/data/pages/search/search.html index 4af747ec6..35b90865d 100644 --- a/src/addon/mod/data/pages/search/search.html +++ b/src/addon/mod/data/pages/search/search.html @@ -13,7 +13,7 @@ {{ 'addon.mod_data.search' | translate}} {{ 'addon.mod_data.advancedsearch' | translate }} -
+ diff --git a/src/addon/mod/data/pages/search/search.ts b/src/addon/mod/data/pages/search/search.ts index e5a0ac8a7..8bd04314b 100644 --- a/src/addon/mod/data/pages/search/search.ts +++ b/src/addon/mod/data/pages/search/search.ts @@ -183,8 +183,13 @@ export class AddonModDataSearchPage { /** * Done editing. + * + * @param {Event} e Event. */ - searchEntries(): void { + searchEntries(e: Event): void { + e.preventDefault(); + e.stopPropagation(); + const searchedData = this.searchForm.value; if (this.search.searchingAdvanced) { diff --git a/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html b/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html index cc32f61e1..e4e86a524 100644 --- a/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html +++ b/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html @@ -33,7 +33,7 @@ - + {{ 'addon.mod_lesson.enterpassword' | translate }} diff --git a/src/addon/mod/lesson/components/index/index.ts b/src/addon/mod/lesson/components/index/index.ts index de7981894..34170064f 100644 --- a/src/addon/mod/lesson/components/index/index.ts +++ b/src/addon/mod/lesson/components/index/index.ts @@ -502,9 +502,13 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo /** * Submit password for password protected lessons. * + * @param {Event} e Event. * @param {HTMLInputElement} passwordEl The password input. */ - submitPassword(passwordEl: HTMLInputElement): void { + submitPassword(e: Event, passwordEl: HTMLInputElement): void { + e.preventDefault(); + e.stopPropagation(); + const password = passwordEl && passwordEl.value; if (!password) { this.domUtils.showErrorModal('addon.mod_lesson.emptypassword', true); diff --git a/src/addon/mod/lesson/pages/password-modal/password-modal.html b/src/addon/mod/lesson/pages/password-modal/password-modal.html index ae59b9d92..b673d540c 100644 --- a/src/addon/mod/lesson/pages/password-modal/password-modal.html +++ b/src/addon/mod/lesson/pages/password-modal/password-modal.html @@ -9,7 +9,7 @@ - + {{ 'addon.mod_lesson.enterpassword' | translate }} diff --git a/src/addon/mod/lesson/pages/password-modal/password-modal.ts b/src/addon/mod/lesson/pages/password-modal/password-modal.ts index d9c116c8f..d748163eb 100644 --- a/src/addon/mod/lesson/pages/password-modal/password-modal.ts +++ b/src/addon/mod/lesson/pages/password-modal/password-modal.ts @@ -29,8 +29,14 @@ export class AddonModLessonPasswordModalPage { /** * Send the password back. + * + * @param {Event} e Event. + * @param {HTMLInputElement} password The input element. */ - submitPassword(password: HTMLInputElement): void { + submitPassword(e: Event, password: HTMLInputElement): void { + e.preventDefault(); + e.stopPropagation(); + this.viewCtrl.dismiss(password.value); } diff --git a/src/addon/mod/lesson/pages/player/player.html b/src/addon/mod/lesson/pages/player/player.html index 3bfc7dff9..86c088030 100644 --- a/src/addon/mod/lesson/pages/player/player.html +++ b/src/addon/mod/lesson/pages/player/player.html @@ -108,7 +108,7 @@ - + diff --git a/src/addon/mod/lesson/pages/player/player.ts b/src/addon/mod/lesson/pages/player/player.ts index 137256b46..01fd5b4bf 100644 --- a/src/addon/mod/lesson/pages/player/player.ts +++ b/src/addon/mod/lesson/pages/player/player.ts @@ -606,8 +606,13 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy { /** * Submit a question. + * + * @param {Event} e Event. */ - submitQuestion(): void { + submitQuestion(e: Event): void { + e.preventDefault(); + e.stopPropagation(); + this.loaded = false; // Use getRawValue to include disabled values. diff --git a/src/addon/mod/quiz/pages/preflight-modal/preflight-modal.html b/src/addon/mod/quiz/pages/preflight-modal/preflight-modal.html index 3d4f6c6eb..b925e9039 100644 --- a/src/addon/mod/quiz/pages/preflight-modal/preflight-modal.html +++ b/src/addon/mod/quiz/pages/preflight-modal/preflight-modal.html @@ -10,7 +10,7 @@ -
+ diff --git a/src/addon/mod/quiz/pages/preflight-modal/preflight-modal.ts b/src/addon/mod/quiz/pages/preflight-modal/preflight-modal.ts index 6a9d3b124..7317b528d 100644 --- a/src/addon/mod/quiz/pages/preflight-modal/preflight-modal.ts +++ b/src/addon/mod/quiz/pages/preflight-modal/preflight-modal.ts @@ -98,8 +98,13 @@ export class AddonModQuizPreflightModalPage implements OnInit { /** * Check that the data is valid and send it back. + * + * @param {Event} e Event. */ - sendData(): void { + sendData(e: Event): void { + e.preventDefault(); + e.stopPropagation(); + if (!this.preflightForm.valid) { // Form not valid. Scroll to the first element with errors. if (!this.domUtils.scrollToInputError(this.content)) { diff --git a/src/addon/notes/pages/add/add.html b/src/addon/notes/pages/add/add.html index 5f5c6bb3b..aaf3bfab8 100644 --- a/src/addon/notes/pages/add/add.html +++ b/src/addon/notes/pages/add/add.html @@ -9,7 +9,7 @@ - + {{ 'addon.notes.publishstate' | translate }} diff --git a/src/addon/notes/pages/add/add.ts b/src/addon/notes/pages/add/add.ts index f31f44528..92cc7e219 100644 --- a/src/addon/notes/pages/add/add.ts +++ b/src/addon/notes/pages/add/add.ts @@ -41,8 +41,13 @@ export class AddonNotesAddPage { /** * Send the note or store it offline. + * + * @param {Event} e Event. */ - addNote(): void { + addNote(e: Event): void { + e.preventDefault(); + e.stopPropagation(); + this.appProvider.closeKeyboard(); const loadingModal = this.domUtils.showModalLoading('core.sending', true); // Freeze the add note button. diff --git a/src/components/search-box/core-search-box.html b/src/components/search-box/core-search-box.html index 127de77e6..7712caf71 100644 --- a/src/components/search-box/core-search-box.html +++ b/src/components/search-box/core-search-box.html @@ -1,5 +1,5 @@ - +