-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Dropdown does not autoclose, throwing: Object doesn't support property or method 'closest' #3783
Comments
Hey @Istanful I we refer to browser support page on angular.io for v8, only the 2 most recent major versions of Edge are supported. With the release of Chromium based Edge back in January, I would say that we don't support EdgeHTML anymore... |
Thank you for the swift answer! Makes perfect sense. About 60% of the application I'm working on uses those old Edge versions, which of course is a shame. Because of that I will have to do some kind of workaround. Do you know of any specific settings I can use that will circumvent this issue? The current solution would be to write a custom auto close strategy and disable yours entirely. :/ |
I would suggest to use a polyfill 🙂 Way much easier. You can have a look at this MDN page |
@benouat I tried using a polyfill. It did not resolve the issue. The issue is not that When the user clicks on the scrollbar the |
oohhh my bad! EdgeHTML actually do support closest 😄 It's only when you click on the scrollbar. Sorry for that. |
@benouat Cool! I will make an attempt on a PR if you don't get to it first. :) |
When autoclosing a dropdown by clicking the scrollbar, an error would be thrown in Edge 44.18362.449.0. This was due to the HTMLDocument not supporting `Element.prototype.closest`.By emulating `Element.prototype.closest` for this specific node, thiscommit circumvents the issue.
When autoclosing a dropdown by clicking the scrollbar, an error would be thrown in Edge 44.18362.449.0. This was due to the HTMLDocument not supporting `Element.prototype.closest`. By emulating `Element.prototype.closest` for this specific node, this commit circumvents the issue.
When autoclosing a dropdown by clicking the scrollbar, an error would be thrown in Edge 44.18362.449.0. This was due to the HTMLDocument not supporting `Element.prototype.closest`. By emulating `Element.prototype.closest` for this specific node, this commit circumvents the issue.
When autoclosing a dropdown by clicking the scrollbar, an error would be thrown in Edge 44.18362.449.0. This was due to the HTMLDocument not supporting `Element.prototype.closest`. By emulating `Element.prototype.closest` for this specific node, this commit circumvents the issue.
When autoclosing a dropdown by clicking the scrollbar, an error would be thrown in Edge 44.18362.449.0. This was due to the HTMLDocument not supporting `Element.prototype.closest`. By emulating `Element.prototype.closest` for this specific node, this commit circumvents the issue.
When autoclosing a dropdown by clicking the scrollbar, an error would be thrown in Edge 44.18362.449.0. This was due to the HTMLDocument not supporting `Element.prototype.closest`. By emulating `Element.prototype.closest` for this specific node, this commit circumvents the issue.
When autoclosing a dropdown by clicking the scrollbar, an error would be thrown in Edge 44.18362.449.0. This was due to the HTMLDocument not supporting `Element.prototype.closest`. By emulating `Element.prototype.closest` for this specific node, this commit circumvents the issue.
@benouat I made a pull request for this. The only different is that |
When autoclosing a dropdown by clicking the scrollbar, an error would be thrown in Edge 44.18362.449.0. This was due to the HTMLDocument not supporting `Element.prototype.closest`. By emulating `Element.prototype.closest` for this specific node, this commit circumvents the issue. Fixes ng-bootstrap#3783.
When autoclosing a dropdown by clicking the scrollbar, an error would be thrown in Edge 44.18362.449.0. This was due to the HTMLDocument not supporting `Element.prototype.closest`. By emulating `Element.prototype.closest` for this specific node, this commit circumvents the issue. Fixes ng-bootstrap#3783.
When autoclosing a dropdown by clicking the scrollbar, an error would be thrown in Edge 44.18362.449.0. This was due to the HTMLDocument not supporting `Element.prototype.closest`. By emulating `Element.prototype.closest` for this specific node, this commit circumvents the issue. Fixes #3783.
Bug 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 inevent.target
isHTMLDocument
which does not support theclosest
method.Link to minimally-working StackBlitz that reproduces the issue:
StackBlitz: https://angular-dpdswh-r6tj5y.stackblitz.io
Edge 44.18362.449.0
.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
The text was updated successfully, but these errors were encountered: