Dropdown does not autoclose, throwing: Object doesn't support property or method 'closest'
See original GitHub issueBug description:
When I open a dropdown with autoclose and then click on the scrollbar in edge, an error is thrown in the console. It throws the error Object doesn't support property or method 'closest'
. It is thrown because the element in event.target
is HTMLDocument
which does not support the closest
method.
Link to minimally-working StackBlitz that reproduces the issue:
StackBlitz: https://angular-dpdswh-r6tj5y.stackblitz.io
- Open the StackBlitz in
Edge 44.18362.449.0
. - Open the dropdown by clicking on it. Click on the scrollbar.
- The dropdown does not close. An error is thrown in the console.
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 8.2.13
ng-bootstrap: 4.2.2
Bootstrap: 4.3.1
Browser: Edge 44.18362.449.0, EdgeHTML 18.18362
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Dropdown Javascript error: object doesn't support property or ...
It looks like you try to check if the click event was triggered by an object with the class dropbtn. If you use...
Read more >Object Doesn't Support this Property or Method - Microsoft Learn
The "object doesn't support this property or method" error occurs when you try to use a method or property that the specified object...
Read more >Migration Guide | Cypress Documentation
Migrating to Cypress 12.0 This guide details the changes and how to change your code to migrate to Cypress version 12.0.
Read more >Unity 2019.1.0a9
Editor: PostProcessing throws errors and tutorials do not start when Learn project is launched (1046727). iOS: Empty project build crashes ...
Read more >Object doesnt support property or method dialog in ASP.Net
When i add a new javascript source to my popup modal page my modal is not appearing. If i remove the above script...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@benouat Cool! I will make an attempt on a PR if you don’t get to it first. 😃
@benouat I made a pull request for this. The only different is that
closest
returns null for document. Apart from the automatic tests I tested in44.18362.449.0
,Safari 14609.2.9.1.3
andChrome 83.0.4103.106
. 😃