Fix TypeError: document.querySelectorAll(...).forEach is not a function

Bug: T298910
Change-Id: Iaa67f36278af7805c5d915737d6b30e98b3f8484
This commit is contained in:
Nicholas Ray 2022-01-10 13:34:01 -07:00
parent 84ed8343c2
commit d9ef1ad66d
1 changed files with 4 additions and 4 deletions

View File

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