Skip to content

Scrollspy feature requested #2903

Closed
Closed

Description

Scrollspy is a jQuery plugin that tracks certain elements and which element the user's screen is currently centered on. The main demo of this is our table of contents on every documentation page to the right/left/top. Clicking on these links will also scroll the page to that element.

Activity

  1. Gaurav-Punjabi commented on Feb 26, 2020

    @Gaurav-Punjabi

    I think this is a good feature, but instead of using Scrollspy can we use Intrapage links of HTML?

  2. Gaurav-Punjabi commented on Feb 28, 2020

    @Gaurav-Punjabi

    No .. the one that we get using id and provide the link to the page with the id of the section that we desire.

  3. chandlerprall commented on Mar 1, 2020

    @chandlerprall
    Contributor

    I'll make sure this is discussed as part of our team's weekly meeting. It might not have enough usages for us to consider the effort to build & maintain worthwhile.

    Particularly, I don't think this should be a straight "copy" of scrollspy - there are many ways that mapping a jQuery plugin to React component can lead to bad user and/or developer experience, and a good first step would be to identify e.g.

    • What Things this should or should not track
    • is a single, "most-visible" element reported, or is it some kind of combination
  4. chandlerprall commented on Mar 4, 2020

    @chandlerprall
    Contributor

    We see the value of this kind of component and are open to a PR for. Before that, I think it would be really good to have an outline/basic spec of the functionality to review first. This would help ensure the component design matches our intent, and allows iterating on the idea before getting to the code. Would you be willing to create such a proposal/high-level design to begin with?

  5. chandlerprall commented on Mar 10, 2020

    @chandlerprall
    Contributor

    That description sounds good. Could you add one more section that describes the technical approach? e.g. what would be used to identify the navigation links, how they find their corresponding section on the page, and how it would detect & update the navigation visuals?

  6. chandlerprall commented on Mar 23, 2020

    @chandlerprall
    Contributor

    Note: if you're proposing this as a Google Summer of Code project, you'll have to submit this through their portal and the conversation will move over there

    Thanks! This sounds good, have a couple comments below but I think it looks good enough to proceed. We'll definitely have some iterations on a PR, so please feel free to push early & often for review.

    We're going to do this by allowing the user to pass in an array of 'id(s)' for page elements that we're going to track.

    IDs get tricky, especially within a componentized system; I'd recommend flexibility here and supporting at least a query selector, maybe an array of selectors, maybe also accept elements directly (i.e. render -> ref -> passed to the spy).

     interface SpyItem{
       inView : boolean;     // tells whether this item is currently in view or not 
       element: HTMLElement;
     } 
    

    Probably need a way to represent how "centered" an item is in the viewport, in case multiple elements are visible

    Also, the spy function needs to run periodically and we can achieve this by using setInterval() and "React life-cycle methods ".

    Let's prefer something a bit less intensive than setInterval and listen for scroll events. This does leave some edge cases, but this is internal to the component so changing it later to be more complete is always an available option.

  7. chandlerprall commented on Mar 24, 2020

    @chandlerprall
    Contributor

    Any idea can be a GSoC proposal :) To be honest, I don't think it's big enough that we'd pursue it that way, but I wanted to include the note in case that is what you were thinking.

  8. chandlerprall commented on Mar 26, 2020

    @chandlerprall
    Contributor

    I think it makes most sense to include it in Navigation

    navigation

  9. cjcenizal commented on Jun 17, 2020

    @cjcenizal
    Contributor

    I think it makes most sense to include it in Navigation

    Does scroll-spy need to be coupled to nav menus? For example, could you also use it to trigger an animation once it gets scrolled into view? Maybe "Utilities" would be a better section for it, though that's starting to become a bit of a kitchen sink. :)

  10. changed the title [-]Scrollspy feature missing.[/-] [+]Scrollspy feature requested[/+] on Sep 20, 2020
  11. github-actions commented on Mar 20, 2021

    @github-actions

    👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

  12. added
    stale-issue
    on Mar 20, 2021
  13. removed
    stale-issue
    on Mar 20, 2021
  14. github-actions commented on Sep 17, 2021

    @github-actions

    👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

  15. added
    stale-issue
    on Sep 17, 2021
  16. github-actions commented on Sep 24, 2021

    @github-actions

    ❌ We're automatically closing this issue due to lack of activity. Please comment if you feel this was done in error.

  17. added
    stale-issue-closed
    on Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale-issuestale-issue-closed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions