Compare commits

...

1 Commits

Author SHA1 Message Date
Nicholas Ray 79b33f2715 Fix TypeError: document.querySelectorAll(...).forEach is not a function
Bug: T298910
Change-Id: Iaa67f36278af7805c5d915737d6b30e98b3f8484
(cherry picked from commit d9ef1ad66d)
2022-01-10 22:10:15 +00:00
1 changed files with 4 additions and 4 deletions

View File

@ -35,10 +35,10 @@ function bind() {
*/
function bindCloseOnUnload() {
addEventListener( 'beforeunload', function () {
document.querySelectorAll( CHECKBOX_HACK_CHECKBOX_SELECTOR + ':checked' )
.forEach( function ( checkbox ) {
/** @type {HTMLInputElement} */ ( checkbox ).checked = false;
} );
var checkboxes = document.querySelectorAll( CHECKBOX_HACK_CHECKBOX_SELECTOR + ':checked' );
Array.prototype.forEach.call( checkboxes, function ( checkbox ) {
/** @type {HTMLInputElement} */ ( checkbox ).checked = false;
} );
} );
}