-
Notifications
You must be signed in to change notification settings - Fork 132
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
Pull getContentRect()
into it's own module?
#4
Comments
The reason I ask, which might be accomplished a better way: I'm trying to selectively ignore resize notifications that are caused by a specific function/block. const eventBus = new EventEmitter();
const el = document.createElement('div');
const observer = new ResizeObserver(() => {
if (someCondition()) {
eventBus.emit('resize')
}
})
observer.observe(el);
modifySizeWithoutTriggeringResize(() => {
// modifications to the size of the element can be made within this function
// and will not trigger a "resize" event on the event bus
$(el).height(100);
}); In order to accomplish this I am thinking that I will:
|
Decided to use the same function to get the size of the element before the notification and within the notification so that I'm not reliant on the implementation here. Sorry for the noise. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you think it would make sense to expose the
getContentRect()
algorithm implemented here as it's own module? There seems to be a fair amount of logic related to ensuring cross-browser compatibility that I would rather not replicate.The text was updated successfully, but these errors were encountered: