-
Notifications
You must be signed in to change notification settings - Fork 22
Add scroll, scrollTo, scrollBy, scrollIntoView #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fe5e61a
to
c7bcf5e
Compare
c3b34f9
to
8069cbc
Compare
We add [`Element.scroll`][1], [`Element.scrollTo`][2], [`Element.scrollBy`][3], and [`Element.scrollIntoView`][4]. [1]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll [2]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo [3]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy [4]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
8069cbc
to
02983df
Compare
Swap function argument order so that it coincides with FFI functions.
bdb7177
to
3e40224
Compare
Thanks for working on this, but it belongs to the CSSOM rather than the DOM. We do have a repo for it, but there's still no initial release or anything. I'll try to get something up soon, and then we can move this over there. |
I'll close this PR now then. Let me know when you've got something up, I'd love to help if I have time. |
There are scroll operations for @garyb I've a question 2 years later ... 😅 Why would these functions belong to UpdateI did find occurences of similar methods for |
It's because they're defined in the CSSOM spec: https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview But actually, actually it's CSSOM-view which is yet another thing! I guess those |
Uh, interesting. There seem to be more examples (besides scroll methods) that are relevant for Element where this would also be the case. https://pursuit.purescript.org/packages/purescript-web-dom/5.0.0/docs/Web.DOM.Element#v:scrollLeft https://pursuit.purescript.org/packages/purescript-web-dom/5.0.0/docs/Web.DOM.Element#v:clientTop |
Update dependency ranges
We add
Element.scroll
,Element.scrollTo
,Element.scrollBy
, andElement.scrollIntoView
.There are more missing methods but this is a start, and what I personally need at the moment. We can also re-export
scroll
,scrollTo
, andscrollBy
withunsafeCoerce
fromWindow -> Element
inpurescript-web-html
.