Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

feat(patch): fix #1011, patch ResizeObserver#1012

Merged
mhevery merged 1 commit intoangular:masterfrom
JiaLiPassion:resize-observer
Feb 12, 2018
Merged

feat(patch): fix #1011, patch ResizeObserver#1012
mhevery merged 1 commit intoangular:masterfrom
JiaLiPassion:resize-observer

Conversation

@JiaLiPassion
Copy link
Copy Markdown
Collaborator

fix #1011.

patch ResizeObserver.

support one observer patch different HtmlElements in different zones.

    const observer1 = new ResizeObserver((entries: any, ob: any) => {
      console.log('observer1 zone', Zone.current);
      for (const entry of entries) {
        console.log('observer1 resize entry target', entry.target);
        console.log('observer1 resize entry size', entry.contentRect);
      }
    });

    observer1.observe(div1);
    observer1.observe(div2);
    Zone.root.run(() => {
      observer1.observe(div3);
    });

full sample can be find here, https://github.com/JiaLiPassion/zone-resize-observer,
only work in Chrome 64.

Copy link
Copy Markdown
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seem to be missing tests?

@JiaLiPassion
Copy link
Copy Markdown
Collaborator Author

@mhevery , got it, I will add test cases, because currently it only support Chrome 64, and travis saucelabs only run on Chrome 63, so I didn't add those cases now, I will add cases to make them runnable in local.

@JiaLiPassion
Copy link
Copy Markdown
Collaborator Author

@mhevery , I have added test cases, and tested locally with Chrome 64, please review. thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ResizeObserver issue

3 participants