Fix css rule and remove using jQuery#5
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an invalid CSS rule by removing spaces between numbers and units, and replaces jQuery usage with native JavaScript methods to eliminate dependencies.
- Replaces jQuery's
outerHeight()method with nativegetBoundingClientRect().height - Fixes CSS spacing issue between numeric values and units
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| // Valore massimo che può assumere "bigWrapper.scrollTop" | ||
| maxima = bigWrapper.scrollHeight - $(bigWrapper).outerHeight() + staller; | ||
| maxima = bigWrapper.scrollHeight - bigWrapper.getBoundingClientRect().height + staller; |
There was a problem hiding this comment.
The replacement of $(bigWrapper).outerHeight() with getBoundingClientRect().height may not be equivalent. jQuery's outerHeight() includes padding, border, and optionally margin, while getBoundingClientRect().height includes padding and border but not margin. Consider using offsetHeight instead for closer equivalence to jQuery's default behavior.
| maxima = bigWrapper.scrollHeight - bigWrapper.getBoundingClientRect().height + staller; | |
| maxima = bigWrapper.scrollHeight - bigWrapper.offsetHeight + staller; |
There was a problem hiding this comment.
Right. But if you look few lines before, margin is set to 0, and neither padding nor border are set, therefore it doesn't make a difference.
This PR does two things: