Skip to content

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

Closed
wants to merge 4 commits into from

Conversation

Shou
Copy link

@Shou Shou commented Jul 25, 2019

We add Element.scroll, Element.scrollTo,
Element.scrollBy, and Element.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, and scrollBy with unsafeCoerce from Window -> Element in purescript-web-html.

@Shou Shou force-pushed the add-scroll-methods-p1 branch from fe5e61a to c7bcf5e Compare July 25, 2019 15:33
@Shou Shou changed the title Add scrollTo, scrollBy, scrollIntoView Add scroll, scrollTo, scrollBy, scrollIntoView Jul 25, 2019
@Shou Shou force-pushed the add-scroll-methods-p1 branch 2 times, most recently from c3b34f9 to 8069cbc Compare July 25, 2019 15:40
@Shou Shou force-pushed the add-scroll-methods-p1 branch from 8069cbc to 02983df Compare July 25, 2019 15:43
Shou added 2 commits July 26, 2019 10:08
Swap function argument order so that it coincides with FFI functions.
@Shou Shou force-pushed the add-scroll-methods-p1 branch from bdb7177 to 3e40224 Compare July 26, 2019 10:32
@garyb
Copy link
Member

garyb commented Aug 2, 2019

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.

@Shou
Copy link
Author

Shou commented Aug 5, 2019

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.

@Shou Shou closed this Aug 5, 2019
@andys8
Copy link

andys8 commented Aug 23, 2021

There are scroll operations for window in web-html Web.HTML.Window but the ones on element like element.scrollIntoView seem to be missing as of today.

@garyb I've a question 2 years later ... 😅 Why would these functions belong to WebCSSOM? I've trouble to understand why would be added to CSS OM. Could you explain?

Update

I did find occurences of similar methods for Element: scrollLeft and it's likely that here would be the best place to add the other scroll methods. If that's the case, should this PR be revived, rebased and reopened? Do you want me to create an issue to track this?

@garyb
Copy link
Member

garyb commented Aug 23, 2021

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 Window scroll operations shouldn't be there, I just let them in mistakenly (the blame says I was the one who added them).

@andys8
Copy link

andys8 commented Aug 24, 2021

sigma-andex pushed a commit to working-group-purescript-es/purescript-web-dom that referenced this pull request Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants