You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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?
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?
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.
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.
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. :)
👋 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.
👋 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.
Activity
Gaurav-Punjabi commentedon Feb 26, 2020
I think this is a good feature, but instead of using Scrollspy can we use Intrapage links of HTML?
Gaurav-Punjabi commentedon Feb 28, 2020
No .. the one that we get using id and provide the link to the page with the id of the section that we desire.
chandlerprall commentedon Mar 1, 2020
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.
chandlerprall commentedon Mar 4, 2020
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?
chandlerprall commentedon Mar 10, 2020
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?
chandlerprall commentedon Mar 23, 2020
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.
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).
Probably need a way to represent how "centered" an item is in the viewport, in case multiple elements are visible
Let's prefer something a bit less intensive than
setIntervaland listen forscrollevents. 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.chandlerprall commentedon Mar 24, 2020
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.
chandlerprall commentedon Mar 26, 2020
I think it makes most sense to include it in Navigation
cjcenizal commentedon Jun 17, 2020
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. :)
[-]Scrollspy feature missing.[/-][+]Scrollspy feature requested[/+]github-actions commentedon Mar 20, 2021
👋 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.
github-actions commentedon Sep 17, 2021
👋 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.
github-actions commentedon Sep 24, 2021
❌ We're automatically closing this issue due to lack of activity. Please comment if you feel this was done in error.