@@ -220,13 +220,7 @@ export class InputBox extends Widget {
220220 } ) ;
221221 }
222222
223- setTimeout ( ( ) => {
224- if ( ! this . input ) {
225- return ;
226- }
227-
228- this . updateMirror ( ) ;
229- } , 0 ) ;
223+ setTimeout ( ( ) => this . updateMirror ( ) , 0 ) ;
230224
231225 // Support actions
232226 if ( this . options . actions ) {
@@ -246,21 +240,17 @@ export class InputBox extends Widget {
246240 }
247241
248242 public setPlaceHolder ( placeHolder : string ) : void {
249- if ( this . input ) {
250- this . input . setAttribute ( 'placeholder' , placeHolder ) ;
251- this . input . title = placeHolder ;
252- }
243+ this . input . setAttribute ( 'placeholder' , placeHolder ) ;
244+ this . input . title = placeHolder ;
253245 }
254246
255247 public setAriaLabel ( label : string ) : void {
256248 this . ariaLabel = label ;
257249
258- if ( this . input ) {
259- if ( label ) {
260- this . input . setAttribute ( 'aria-label' , this . ariaLabel ) ;
261- } else {
262- this . input . removeAttribute ( 'aria-label' ) ;
263- }
250+ if ( label ) {
251+ this . input . setAttribute ( 'aria-label' , this . ariaLabel ) ;
252+ } else {
253+ this . input . removeAttribute ( 'aria-label' ) ;
264254 }
265255 }
266256
@@ -560,20 +550,18 @@ export class InputBox extends Widget {
560550 }
561551
562552 protected applyStyles ( ) : void {
563- if ( this . element ) {
564- const background = this . inputBackground ? this . inputBackground . toString ( ) : null ;
565- const foreground = this . inputForeground ? this . inputForeground . toString ( ) : null ;
566- const border = this . inputBorder ? this . inputBorder . toString ( ) : null ;
553+ const background = this . inputBackground ? this . inputBackground . toString ( ) : null ;
554+ const foreground = this . inputForeground ? this . inputForeground . toString ( ) : null ;
555+ const border = this . inputBorder ? this . inputBorder . toString ( ) : null ;
567556
568- this . element . style . backgroundColor = background ;
569- this . element . style . color = foreground ;
570- this . input . style . backgroundColor = background ;
571- this . input . style . color = foreground ;
557+ this . element . style . backgroundColor = background ;
558+ this . element . style . color = foreground ;
559+ this . input . style . backgroundColor = background ;
560+ this . input . style . color = foreground ;
572561
573- this . element . style . borderWidth = border ? '1px' : null ;
574- this . element . style . borderStyle = border ? 'solid' : null ;
575- this . element . style . borderColor = border ;
576- }
562+ this . element . style . borderWidth = border ? '1px' : null ;
563+ this . element . style . borderStyle = border ? 'solid' : null ;
564+ this . element . style . borderColor = border ;
577565 }
578566
579567 public layout ( ) : void {
@@ -594,13 +582,11 @@ export class InputBox extends Widget {
594582 public dispose ( ) : void {
595583 this . _hideMessage ( ) ;
596584
597- this . element = null ! ; // StrictNullOverride: nulling out ok in dispose
598- this . input = null ! ; // StrictNullOverride: nulling out ok in dispose
599- this . contextViewProvider = undefined ;
600585 this . message = null ;
601- this . validation = undefined ;
602- this . state = null ! ; // StrictNullOverride: nulling out ok in dispose
603- this . actionbar = undefined ;
586+
587+ if ( this . actionbar ) {
588+ this . actionbar . dispose ( ) ;
589+ }
604590
605591 super . dispose ( ) ;
606592 }
0 commit comments