Issue #737Opened January 10, 2018by austinbiggs0 reactions

While dragging, increase the "range" of the auto-scrolling

Question

Is it possible to increase the "range" of the vertical auto-scrolling.

Already, when a user is in the top x% of the window (while dragging) the editor will scroll up. The same is true for scrolling down of course.

What I'm curious about, is where this is controlled? I'm not sure what to search besides "scroll" or potentially "scrolltop". Both of which didn't help me find what I'm looking for.

Does anyone know on what lines the code for this is on?

Answers (2)

austinbiggsJanuary 10, 20180 reactions

I was able to accomplish this by changing the value of the variable limitTop.

      e.preventDefault();
      if (this.dragging) {
        var frameWindow = this.getFrameEl().contentWindow;
        var actualTop = frameWindow.document.body.scrollTop;
        var nextTop = actualTop;
        var clientY = e.clientY;
        var limitTop = 150;
        var limitBottom = frameRect.height - limitTop;

        if (clientY < limitTop) {
          nextTop -= limitTop - clientY;
        }

        if (clientY > limitBottom) {
          nextTop += clientY - limitBottom;
        }

        //console.log(`actualTop: ${actualTop} clientY: ${clientY} nextTop: ${nextTop} frameHeigh: ${frameRect.height}`);
        frameWindow.scrollTo(0, nextTop);
      }
    },```
lock[bot]September 18, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.