Skip to content

Menu: Account for scrollbars in jQuery 3.2 #1929

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

Merged
merged 1 commit into from
Jul 23, 2020

Conversation

mgol
Copy link
Member

@mgol mgol commented Jun 24, 2020

jQuery >=3.2 doesn't include scrollbars in .height(), this commit switches
it to .innerHeight() which does so in jQuery >=3.3. In jQuery 3.2 it doesn't
either so include scrollbars in innerHeight, add it back.

Using .innerHeight() instead of .height() should be fine as menu doesn't
define padding styles.

jQuery >=3.2 doesn't include scrollbars in `.height()`, this commit switches
it to `.innerHeight()` which does so in jQuery >=3.3. In  jQuery 3.2 it doesn't
either so include scrollbars in innerHeight, add it back.

Using `.innerHeight()` instead of `.height()` should be fine as menu doesn't
define padding styles.
@mgol mgol added this to the 1.13 milestone Jun 24, 2020
@mgol mgol requested review from fnagel, arschmitz and a team June 24, 2020 16:34
height = this.element.innerHeight();

// jQuery 3.2 doesn't include scrollbars in innerHeight, add it back.
if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not using < 3.3?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because only 3.2 has this bug. See jquery/jquery#3589.

Copy link
Member

@fnagel fnagel left a comment

Choose a reason for hiding this comment

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

+1 by reading

@mgol mgol merged commit 1712b9b into jquery:master Jul 23, 2020
@mgol mgol deleted the menu-3.2-scrollbar-fix branch July 23, 2020 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants