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

fix(background): fortify hasDOMDimensions check for null height #592

Merged

Conversation

stephencookdev
Copy link
Contributor

@stephencookdev stephencookdev commented Mar 31, 2020

Description

This PR changes the hasDOMDimensions to check for DOM width and height, rather than just the top — which will exist in cases where we still don't want to consider the DOM dimensions "usable".

This should fix #591 — which should, I imagine, stop Imgix from getting quite a few 400s

Checklist

Please use the checklist that is most closely related to your PR (you only need to use one checklist, and you can skip items that aren't applicable or don't make sense):

Bug Fix

  • All existing unit tests are still passing (if applicable)
  • Add new passing unit tests to cover the code introduced by your PR
  • Add some steps so we can test your bug fix
  • The PR title is in the conventional commit format: e.g. fix(<area>): fixed bug #issue-number
  • Add your info to the contributors array in package.json!

N/A:

  • (done since N/A) Update the readme
  • (done since N/A) Update or add any necessary API documentation

Steps to Test

The new unit test should be sufficient.

But if you want to test manually, too, then create a <div style={{ width: 100, height: 0 }} /><Background /></div> element

Related issue: #591

@commit-lint
Copy link

commit-lint bot commented Mar 31, 2020

Contributors

@stephencookdev

Copy link
Contributor

@sherwinski sherwinski left a comment

Choose a reason for hiding this comment

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

Great catch and thanks for the fix @stephencookdev!
This looks good to me. I'll merge and cut a new release shortly.

@sherwinski sherwinski changed the title fix(background): fixed bug #591 fix(background): fortify hasDOMDimensions check for null height Apr 1, 2020
@sherwinski sherwinski merged commit c7fb86e into imgix:master Apr 1, 2020
@sherwinski
Copy link
Contributor

@all-contributors add @stephencookdev for code and bugs

@allcontributors
Copy link
Contributor

@sherwinski

I've put up a pull request to add @stephencookdev! 🎉

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.

<Background /> with a width (and top) but no height causes Imgix 400
2 participants