Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing dropdown error on IE. #303

Closed
ksamborn opened this issue Feb 27, 2018 · 2 comments · Fixed by #305
Closed

Closing dropdown error on IE. #303

ksamborn opened this issue Feb 27, 2018 · 2 comments · Fixed by #305
Labels

Comments

@ksamborn
Copy link

Please fill below information if issuing a bug report.

Expected behaviour

The dropdown should close without error.

Actual behaviour

The dropdown does not close and has a console error

Can be seen in the demos and here:

https://plnkr.co/edit/4vVcBF?p=preview

TypeError: Object doesn't support property or method 'remove'
   at NgDropdownPanelComponent.prototype.ngOnDestroy (http://localhost:8080/vendor.bundle.js:390760:9)
   at callProviderLifecycles (http://localhost:8080/vendor.bundle.js:11390:9)
   at callElementProvidersLifecycles (http://localhost:8080/vendor.bundle.js:11355:13)
   at callLifecycleHooksChildrenFirst (http://localhost:8080/vendor.bundle.js:11339:17)
   at destroyView (http://localhost:8080/vendor.bundle.js:12678:5)
   at ViewContainerRef_.prototype.clear (http://localhost:8080/vendor.bundle.js:10217:13)
   at NgIf.prototype._updateView (http://localhost:8080/vendor.bundle.js:26667:17)
   at ngIf.set (http://localhost:8080/vendor.bundle.js:26620:13)
   at updateProp (http://localhost:8080/vendor.bundle.js:11300:5)
   at checkAndUpdateDirectiveInline (http://localhost:8080/vendor.bundle.js:11009:9)

In our application we are a hybrid NG1 app and the ng-select is a downgraded component. The error causes the entire page to crash. Only happens on IE

More Info

ng-select version: 0.23.1

browser: IE

Version: IE 11.248.16299.0
Update Versions: 111.0.51 (KB4074736)

reproducible in demo page: YES, and Plunker

@anjmao
Copy link
Member

anjmao commented Feb 28, 2018

@ksamborn This happens because of this line

this._elementRef.nativeElement.remove();

IE 11 does not support .remove method, instead it should be node.parentNode.removeChild(node)

@anjmao anjmao added the bug label Feb 28, 2018
@varnastadeus
Copy link
Member

varnastadeus commented Feb 28, 2018

@anjmao I suggest using Renderer2 in this case.

anjmao added a commit that referenced this issue Feb 28, 2018
jakemdunn pushed a commit to jakemdunn/ng-select that referenced this issue Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants