Breaking Change to scrollX() and scrollY()

We have risked a breaking change in ZIM 019 by removing scrollX() and scrollY() and replacing them with getScrollX() and getScrollY() to avoid over writing the window scrollX and scrollY properties. Thanks @Chris_S for pointing this out.

[SEE NEW CHANGE OF NAME BELOW]

These are HTML ZIM functions, so we expect lesser used and we are hoping that within this time from the ZIM 019 launch that it will not affect apps. We usually would not take this risk, but we are wanting to proceed with a createjs update to version 2 that needs scrollX and scrollY intact.

1 Like

If someone needs to get scrollX, they should probably use the built in way directly, window.scrollX

Would it be better to call the ZIM function scrollToX(), as a getter shouldn’t really have a side effect?

Note this doesn’t clash with the existing window.scrollTo(x, y)

1 Like

Oh ya - actually it is a get and set method. Hmmm... will have to change the name again. Yikes. I blame my cat. It is scratching at my legs as I type.

browserScrollX() browserScrollY()

is what we will use.

lol - here I am worried about other people with broken code and our Docs are broken!

Really appreciate the transparency here. Seeing the naming and getter/setter discussion around scrollX is super helpful from a learning perspective