Repository navigation
fix(challenge): use offsetHeight to get height value - #36995
Merged
RandellDawson merged 1 commit intoOct 27, 2019
Conversation
Contributor
Author
|
I believe I have confirmation that |
Contributor
|
Thank you for your thorough investigation and fix for this issue, @lasjorg. Tested on GitPod and everything LGTM. |
scissorsneedfoodtoo
approved these changes
Oct 24, 2019
RandellDawson
approved these changes
Oct 27, 2019
Member
|
Thank you for your contribution to the page! 👍 |
lasjorg
deleted the
fix/adjust-the-height-of-an-element-using-the-height-property
branch
November 5, 2019 04:15
This was referenced Apr 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update index.md)masterbranch of freeCodeCamp.The challenge test relies on getComputedStyle (jquery css() function) which, for
heightat least, may not return a reliable result. There are reported cases of this failing and returning decimal numbers. This fix replacescss()withelement.offsetHeight.I should note that as I can't reproduce this bug, I can't reliably test if this is a solution either. I believe it is very likely to be a fix but it would be nice to get some confirmation. I have posted in the forum and may be able to get some data back.
Note: The challenge also has a
widthcounterpart challenge, which is using the same reliance on getComputedStyle. I have not seen any bug reports for it. But that doesn't mean there aren't any and it may need the same fix.Adjust the Width of an Element Using the width Property
https://learn.freecodecamp.org/responsive-web-design/applied-visual-design/adjust-the-width-of-an-element-using-the-width-property
Closes #18045