File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -248,14 +248,16 @@ export class ComponentLoader<T> {
248
248
return ;
249
249
}
250
250
// why: should run after first event bubble
251
- const target = this . _componentRef . location . nativeElement ;
252
- setTimeout ( ( ) => {
253
- this . _globalListener = registerOutsideClick ( this . _renderer , {
254
- targets : [ target , this . _elementRef . nativeElement ] ,
255
- outsideClick : this . _listenOpts . outsideClick ,
256
- hide : ( ) => this . _listenOpts . hide ( )
251
+ if ( this . _listenOpts . outsideClick ) {
252
+ const target = this . _componentRef . location . nativeElement ;
253
+ setTimeout ( ( ) => {
254
+ this . _globalListener = registerOutsideClick ( this . _renderer , {
255
+ targets : [ target , this . _elementRef . nativeElement ] ,
256
+ outsideClick : this . _listenOpts . outsideClick ,
257
+ hide : ( ) => this . _listenOpts . hide ( )
258
+ } ) ;
257
259
} ) ;
258
- } ) ;
260
+ }
259
261
}
260
262
261
263
public getInnerComponent ( ) : ComponentRef < T > {
You can’t perform that action at this time.
0 commit comments