-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Added navigation feature #97
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are accessibility issues in these changes.
> | ||
<div> | ||
<div style={{ width: "250px", height: "250px" }}> | ||
<img style={{ maxWidth: "100%", maxHeight: "100%" }} src="https://cdn.tutsplus.com/net/uploads/2013/08/github-collab-retina-preview.gif" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image is missing a text alternative (alt
attribute). This is a problem for people using screen readers.
> | ||
<div> | ||
<div style={{ width: "250px", height: "250px" }}> | ||
<img style={{ maxWidth: "100%", maxHeight: "100%" }} src="https://cdn.tutsplus.com/net/uploads/2013/08/github-collab-retina-preview.gif" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image is missing a text alternative (alt
attribute). This is a problem for people using screen readers.
@highfield thanks for opening the PR. the proposal looks good to me. can you fix the lint issues please. |
@prabhuignoto I'd love to fix them, but I have no practice with linter. By the way, the analisys shows some strange informations to me. For instance, anonymous functions are a very common practice with React hooks: should we take all of them as named? Let me know. |
Kudos, SonarCloud Quality Gate passed! |
Here is my proposal for adding the navigation feature.
The
Chrono
component now exposes a new optional propertyinitialActiveTimelineItem
, which instructs the component which item should activate on load. That comes useful when the timeline shows items where the most recent is the most interesting (es. incoming mail messages).There's another modification: the ability to navigate programmatically to any of the loaded items. That is done by exposing a kind of "API" via ref. That comes useful when the component is already shown, but you need to highlight the item upon something else selection.
It would be nice if the initial scrolling will happen without animation, but I was unable to follow your code to do that.
Let me know if you need clarifications about my code.
Mario