sticky-sidebar icon indicating copy to clipboard operation
sticky-sidebar copied to clipboard

MacOS, iOS rubber band effect bug

Open dajanvulaj opened this issue 6 years ago • 1 comments

In mac devices when rubber band (Over Scroll) effect is present, when using MagicMouse or TouchPad , sticked element keeps dropping down under the page, this happens because the body element expands it's height depending on how much does the user scrolls to the bottom!

dajanvulaj avatar Jul 19 '18 09:07 dajanvulaj

Ok so I found a way to fix it. The thing is that on macOS systems, the scrollbar scrolls more than the actual height of the page, so by disabling the Sticky Sidebar on that case the problem is fixed!

` value: function updateSticky() { var _this3 = this;

      var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      if (this._running) return;
      this._running = true;

      (function (eventType) {
        requestAnimationFrame(function () {
          switch (eventType) {
            // When browser is scrolling and re-calculate just dimensions
            // within scroll. 
            case 'scroll':
              if($(window).scrollTop() + $(window).height() < $(document).height()) {
                _this3._calcDimensionsWithScroll();
                _this3.observeScrollDir();
                _this3.stickyPosition();
              }
              break;

            // When browser is resizing or there's no event, observe width
            // breakpoint and re-calculate dimensions.
            case 'resize':
            default:
              _this3._widthBreakpoint();
              _this3.calcDimensions();
              _this3.stickyPosition(true);
              break;
          }
          _this3._running = false;
        });
      })(event.type);
    }`

dajanvulaj avatar Jul 20 '18 12:07 dajanvulaj