Skip to content

Commit

Permalink
fix(modals): don't try to register outside click handler
Browse files Browse the repository at this point in the history
fixes #2477
  • Loading branch information
valorkin committed Aug 23, 2017
1 parent e59172f commit d8e614c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/component-loader/component-loader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,16 @@ export class ComponentLoader<T> {
return;
}
// why: should run after first event bubble
const target = this._componentRef.location.nativeElement;
setTimeout(() => {
this._globalListener = registerOutsideClick(this._renderer, {
targets: [target, this._elementRef.nativeElement],
outsideClick: this._listenOpts.outsideClick,
hide: () => this._listenOpts.hide()
if (this._listenOpts.outsideClick) {
const target = this._componentRef.location.nativeElement;
setTimeout(() => {
this._globalListener = registerOutsideClick(this._renderer, {
targets: [target, this._elementRef.nativeElement],
outsideClick: this._listenOpts.outsideClick,
hide: () => this._listenOpts.hide()
});
});
});
}
}

public getInnerComponent(): ComponentRef<T> {
Expand Down

4 comments on commit d8e614c

@mcsugaman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this fix be available soon ?

@valorkin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1.9.1 already published ;)

@valorkin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcsugaman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superb, it's working perfectly !

Please sign in to comment.