File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,9 +161,8 @@ class ActionForm {
161161 private readonly stepInput : HTMLInputElement ;
162162 private readonly pageInput : HTMLInputElement ;
163163
164- constructor ( formElement : HTMLElement , config : any ) {
165- formElement . setAttribute ( 'novalidate' , 'novalidate' ) ;
166- this . selectElement = formElement . querySelector ( 'select[name="action"]' ) ! ;
164+ constructor ( formElement : HTMLFormElement , selectElement : HTMLSelectElement , config : any ) {
165+ this . selectElement = selectElement ;
167166 this . config = config ;
168167 this . selectElement . addEventListener ( 'change' , ( ) => this . actionChanged ( ) ) ;
169168
@@ -289,8 +288,11 @@ window.addEventListener('load', (event) => {
289288 }
290289
291290 const changelistForm = document . getElementById ( 'changelist-form' ) ;
292- if ( changelistForm ) {
293- new ActionForm ( changelistForm , adminSortableConfig ) ;
291+ if ( changelistForm instanceof HTMLFormElement ) {
292+ const selectElement = changelistForm . querySelector ( 'select[name="action"]' ) ;
293+ if ( selectElement instanceof HTMLSelectElement ) {
294+ new ActionForm ( changelistForm , selectElement , adminSortableConfig ) ;
295+ }
294296 }
295297 }
296298
You can’t perform that action at this time.
0 commit comments