-
Notifications
You must be signed in to change notification settings - Fork 7
after first browser render, check sizes again (fixes #8) #9
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
Conversation
Thanks @jokeyrhyme! Can you take a look at why the tests are failing? |
Weird. It's passing the browser tests now in Travis CI, but is still coming up with a failure. I'll look into this later today perhaps. |
Thanks @jokeyrhyme! |
@@ -110,18 +115,18 @@ static _componentMap = new Map() | |||
let matchedSize = '' | |||
let matchedWidth = smallestSize.width | |||
|
|||
// use Array#some() here because #forEach() has no early exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the adding clarification!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it took me a second to realise why that choice was made, and I figured it was worth spelling out. :)
@joeybaker there we go. It was a Travis CI environment issue: not having an X service available for Firefox to use. Green! |
@@ -13,3 +14,9 @@ sudo: false | |||
|
|||
before_install: | |||
- "npm install -g npm@latest" | |||
|
|||
# https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI | |||
before_script: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird that this didn't break before. Thanks!
@jokeyrhyme Thanks! Released as v2.0.2, and added you as a collaborator. Just use |
I've added a second call to
sizeComponent()
a few frames aftercomponentDidMount()
.I tried
setTimeout(fn, 0)
and that was too early, and I also triedsetTimeout(fn, 1e3)
and it worked but the delay was far too visibly obvious.Let me know if you'd like a squash, or if you'd like me to undo some of the other changes I snuck in (as separate commits), or if you have other comments.
Fixes #8