angular-scroll icon indicating copy to clipboard operation
angular-scroll copied to clipboard

The `offset` attribute name collides with `angular-material`

Open pmowrer opened this issue 9 years ago • 4 comments

Angular Material applies an offset-x class when it detects an offset="x" attribute on an element. https://github.com/angular/material/issues/869

Both projects probably ought to namespace the use of attribute names.

pmowrer avatar Nov 04 '15 20:11 pmowrer

Hi @pmowrer,

Have you tried using the duScrollOffset setting instead?

oblador avatar Nov 19 '15 18:11 oblador

I have, but it only allows a single setting across the whole app.

On Thursday, November 19, 2015, Joel Arvidsson [email protected] wrote:

Hi @pmowrer https://github.com/pmowrer,

Have you tried using the duScrollOffset setting instead?

— Reply to this email directly or view it on GitHub https://github.com/oblador/angular-scroll/issues/158#issuecomment-158153817 .

pmowrer avatar Nov 19 '15 19:11 pmowrer

Hi guys, I'm using angular-scroll with angular-material and faced the problem, when it only scrolls by x dimension but not 'y'. Do you know if that is related or I'm just missing some details?

Here is my simplified example:

<md-content flex du-scroll-container>
    <div class='documents-cntainer'>
         <div id='document1'><img></div>
         <div id='document2'><img></div>
         <div id='document3'><img></div>
    </div>
<md-content>

then somewhere in the controller:

   var someElement = angular.element(document.getElementById('document3'));
   $document.scrollToElement(someElement, 30, 500);

As I sad it's only moves by x axis, but not y

Also I have to mention that <div id='document2'><img></div> has defined absolute position in css.

polinom avatar Mar 03 '16 20:03 polinom

Ok, my fault I was calling scrollToElement method on $document, when it should be the container element.

polinom avatar Mar 03 '16 21:03 polinom