kibu-australia / pushy

Clojurescript library for quick and easy HTML5 pushState
Eclipse Public License 1.0
223 stars 28 forks source link

Object doesn't support property or method 'closest' #32

Open colindresj opened 7 years ago

colindresj commented 7 years ago

Looks like pushy is using a function that isn't supported in IE. Might want to consider a polyfill or relying on .parentNode instead.

Happy to put together a pull request based on any input.

jwr commented 6 years ago

I just turned on client-side application logging and discovered that some of my users experience app crashes because of this. As it is now, pushy does not work with Internet Explorer.

jwr commented 6 years ago

Ok, so since this completely breaks IE for applications that use pushy, here's a quick workaround I've found:

In your compiler options add:

                                        :install-deps true
                                        :npm-deps {"element-closest" "2.0.2"}

And add ["element-closest"] to :require somewhere in your app. This will install the element-closest polyfill that provides the closest method to browsers that do not support it. Requires a recent ClojureScript with :npm-deps support.