ng-scrollbar icon indicating copy to clipboard operation
ng-scrollbar copied to clipboard

Scroll is not working in Mobile devices

Open vijayshegokar opened this issue 10 years ago • 5 comments

Hello, I'm using this ng-scrollbar to make beautiful scrolling view in my HTML pages. It seems good in desktop website but didn't work in mobile devices. Am I missing something? or This library support desktop websites only?

vijayshegokar avatar Jul 17 '15 05:07 vijayshegokar

Same thing. I'm trying to fix it, but, maybe it will be better to write my own from scratch andcreate new unuseable thing.

seitbekir avatar Mar 18 '16 10:03 seitbekir

Was this ever resolved?

Thought it was my implementation(inside a resizing div, inside a flexbox layout :s ) , but the demo confirms the issue is with the plugin itself.

CosyStudios avatar Jun 20 '16 16:06 CosyStudios

Heres a cheeky fix...... REPLACE

thumb.on('touchstart', function (event) {
              lastOffsetY = event.originalEvent.changedTouches[0].pageY - thumb[0].offsetTop;
              win.on('touchend', _touchEnd);
              win.on('touchmove', _touchDragHandler);
              event.preventDefault();
            });

with transculdedContainer.on('touchStart).......

AND

--- yes this works, but the action is opposite what is expected from a direct touch so altered code should be as above, replacing thumb with transcludedContainer

so changing the thumbDrag handler from

var thumbDrag = function (event, offsetX, offsetY) {
          dragger.top = Math.max(0, Math.min(parseInt(dragger.trackHeight, 10) - parseInt(dragger.height, 10), offsetY));
          event.stopPropagation();
        };

to

var thumbDrag = function (event, offsetX, offsetY) {
          dragger.top = Math.max(0, Math.min(parseInt(dragger.trackHeight, 10) - parseInt(dragger.height, 10), **-**offsetY));
          event.stopPropagation();
        };

(ammended a '-' to offsetY)

CosyStudios avatar Jun 20 '16 16:06 CosyStudios

Id do pull/push thingy from git if I can ever work out how that works!

CosyStudios avatar Jun 20 '16 17:06 CosyStudios

@CosyStudios the first replace, how and where to place it? can you paste the whole solution?

Jaspur avatar May 18 '17 08:05 Jaspur