waypoints icon indicating copy to clipboard operation
waypoints copied to clipboard

inview does not work well with elements in <svg>

Open firzgard opened this issue 9 years ago • 4 comments

I tried using inview with g elements in svg. I am not sure but, the "enter" and "entered" seem to be triggered at the same time, or sometime only one of them. Same for "exit" and exited". In short, handlers are triggered all over the place, not in their supposed order.

Edit 1 So I tested again:

  • "entered" is fired at the moment part of element enter viewport.
  • "exited" is fired at the moment part of element leave viewport.

Edit 2 This seems to be related to scroll direction.

firzgard avatar Nov 21 '15 07:11 firzgard

@megafirzen Do you have an example I could look at?

imakewebthings avatar Mar 01 '16 18:03 imakewebthings

I believe that I have lost the file I found this problem on, so I create this new example. Hope this helps.

firzgard avatar Mar 02 '16 06:03 firzgard

@megafirzen It looks like this stems from the use element, perhaps in this situation or in every situation, reporting clientHeight as 0. So jQuery and my noframework adapter both think the height is 0. I'll mark this as a bug since getBoundingClientRect appears to give us the right height and further investigation may reveal that I can switch to using it.

imakewebthings avatar Mar 03 '16 16:03 imakewebthings

Any changes?

devcken avatar Oct 27 '16 07:10 devcken