vdolek / angular-resize-event

Angular directive for detecting changes of an element size.
MIT License
169 stars 63 forks source link

Does not support iOS 3.2 - 13.3 #54

Open matt-jensen-purple opened 2 years ago

matt-jensen-purple commented 2 years ago

Hi there and thanks for this directive.

I am encountering an issue where this plugin does not work on iOS12, where I get the error: Uncaught (in promise): ReferenceError: Can't find variable: ResizeObserver

According to 'Can I Use' for ResizeObserver, as per https://caniuse.com/resizeobserver, ResizeObserver will not work on any of iOS 3.2 - 13.3.

Given that iOS 13.3 is not that old - only a bit over 2 years old as of writing, having been released in Dec 2019 - it'd be good to know what the options are for supporting these devices.

Adding a polyfill to your directive could be an option, such as https://github.com/que-etc/resize-observer-polyfill, which according to the author only adds 2.44KB when minified and gzipped.

Otherwise, perhaps falling back to eg. v2.1.0 would be an option, although I'm not having luck with that approach at the moment though.

ha-akelius commented 2 years ago

do we have a solution for this @matt-jensen-purple have you tried adding the polyfill?

matt-jensen-purple commented 2 years ago

We downgraded our application to use v2.1.0 and it solved the problem. I did try pre-loading the polyfill (as opposed to forking this package and actually including the polyfill in it) but it didn't work, although I didn't have time to spend experimenting further.