Skip to content
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

recalculate if container dom changed. #121

Open
yaquawa opened this issue Aug 13, 2020 · 2 comments
Open

recalculate if container dom changed. #121

yaquawa opened this issue Aug 13, 2020 · 2 comments

Comments

@yaquawa
Copy link

yaquawa commented Aug 13, 2020

I think to use ResizeSensor.js is a bit overkill, why not just add a few lines to use MutationObserver instead ? (if the browser supports)

@SlimerDude
Copy link

SlimerDude commented Sep 18, 2020

ResizeSensor.js does use the Mutation Observer API, the problem is that mutations are a bad fit for resize events.

Instead I think you'll want to use a Resize Observer - but there's no support for IE and limited Firefox support.

@yaquawa
Copy link
Author

yaquawa commented Sep 22, 2020

Hi @SlimerDude , I mean if ResizeSensor.js is not detected, fallback to use MutationObserver or as you said the Resize Observer if browser supports. Chances are many people like me don't support IE, so no need to use ResizeSensor.js at all, it increase the bundle size a lot.

Currently I can use Mutation Observer to call the update method of sticky-sidebar when the content of the sidebar changed, but I would like see this tiny logic could be sit in the core in the first place.

I use this library in many of my projects, I really appreciate your great work, and hope this little change can be added to the core. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants