Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fixed params to be set when mounted after resize events #72

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
Loading
from

Conversation

natevoci
Copy link

@natevoci natevoci commented Mar 9, 2018

Added code to set params when observing an element, otherwise params would return an empty object until the next resize event after mounting occurred.

I've also added a test for this case. Before my changes this test would fail with

    × sets params when mounted after resize events
        Expected '{}' to be '{"desktop":false,"mobile":true}'.

…uld return an empty object until the next resize event after mounting occurred.
this._processSize({
width: this._getNumber(styles.width),
height: this._getNumber(styles.height),
});
Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the late reply.

Hmm, this is interesting. I don't fully understand. I have to investigate a bit. I thought once observe is called, the callback registered with ResizeObserverLite will be triggered immediately. But look like it's not.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah. It is interesting. I didn't look into ResizeObserverLite to see if there is a problem in there. I just assumed that if all the resize events were finished by the time the component was mounted then ResizeObserverLite would have no trigger to fire it.

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

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.