When using jQuery3 the admin modal height extends below the viewport without a scrollbar making the hidden options inaccessible.

This is due to calls to outerHeight() with an undefined selector returning undefined rather than null as they used to.

In Javascript adding null to a value is equivalent to adding 0, however adding undefined results in the value becoming NaN (Not-A-Number), which is the root cause of the scrollbar not appearing issue.

This can be worked around in a backwards compatible manner by ORing with 0, if outerHeight() returns a valid number it will be used, otherwise the ORd 0 will be used.

js/views-admin.js

    // Now, calculate what the difference between the scroll and the modal
    // will be.

    var difference = 0;
    difference += parseInt($scroll.css('padding-top'));
    difference += parseInt($scroll.css('padding-bottom'));
-   difference += $('.views-override').outerHeight(true);
-   difference += $('.views-messages').outerHeight(true);
-   difference += $('#views-ajax-title').outerHeight(true);
-   difference += $('.views-add-form-selected').outerHeight(true);
-   difference += $('.form-buttons', $modal).outerHeight(true);
+   difference += $('.views-override').outerHeight(true) || 0;
+   difference += $('.views-messages').outerHeight(true) || 0;
+   difference += $('#views-ajax-title').outerHeight(true) || 0;
+   difference += $('.views-add-form-selected').outerHeight(true) || 0;
+   difference += $('.form-buttons', $modal).outerHeight(true) || 0;
CommentFileSizeAuthor
#4 2916772-4.patch1016 bytesrpayanm

Comments

MustangGB created an issue. See original summary.

mustanggb’s picture

Issue summary: View changes
mustanggb’s picture

Another easy straight forward fix.

rpayanm’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1016 bytes

Please review.

mustanggb’s picture

Status: Needs review » Reviewed & tested by the community

  • DamienMcKenna committed 6ac3538 on 7.x-3.x
    Issue #2916772 by rpayanm, MustangGB: Admin modal is not compatible with...
damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.