reedsy / quill-cursors

A multi cursor module for Quill text editor.
MIT License
248 stars 54 forks source link

Use `ResizeObserver` instead of listening for window `resize` event #24

Closed alecgibson closed 5 years ago

alecgibson commented 5 years ago

We currently listen for resize events fired on the window to redraw the cursors.

However, this approach misses the event where the editor is resized for other reasons (such as through JavaScript), without the window being resized.

Ideally, we'd use the new ResizeObserver class, but this is restricted just to Chrome for now. Instead, we're using a polyfill.