Verified Commit 70db0faf authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3372922 by Spokje, darvanen, msbtterswrth, Wim Leers: Regression:...

Issue #3372922 by Spokje, darvanen, msbtterswrth, Wim Leers: Regression: infinite height prevention disables scrolling in Source view

(cherry picked from commit 91609efd)
parent d2392d13
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -19,3 +19,8 @@
   * any toolbars. */
  max-height: calc(100vh - var(--drupal-displace-offset-top, 0px) - var(--drupal-displace-offset-bottom, 0px) - 20px);
}

/* Show the scrollbar on the source editing area. */
.ck-editor__main > .ck-source-editing-area textarea {
  overflow: auto;
}
+41 −0
Original line number Diff line number Diff line
@@ -125,6 +125,47 @@ module.exports = {
            );
          },
        )
        // Source Editor textarea should have vertical scrollbar when needed.
        .click('.ck-source-editing-button')
        .waitForElementVisible('.ck-source-editing-area')
        .execute(
          // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow
          function () {
            function isScrollableY(element) {
              const style = window.getComputedStyle(element);

              if (
                element.scrollHeight > element.clientHeight &&
                style.overflow !== 'hidden' &&
                style['overflow-y'] !== 'hidden' &&
                style.overflow !== 'clip' &&
                style['overflow-y'] !== 'clip'
              ) {
                if (
                  element === document.scrollingElement ||
                  (style.overflow !== 'visible' &&
                    style['overflow-y'] !== 'visible')
                ) {
                  return true;
                }
              }

              return false;
            }

            return isScrollableY(
              document.querySelector('.ck-source-editing-area textarea'),
            );
          },
          [],
          (result) => {
            browser.assert.strictEqual(
              result.value,
              true,
              'Source Editor textarea should have vertical scrollbar when needed.',
            );
          },
        )

        // Double the editor row count.
        .drupalRelativeURL('/admin/structure/types/manage/test/form-display')