Skip to content
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

Change order in object.assign to prefer user provided props #74

Closed
wants to merge 1 commit into from
Closed

Change order in object.assign to prefer user provided props #74

wants to merge 1 commit into from

Conversation

ajeetshah
Copy link

Change order in object.assign to prefer user provided props over default ones

@prabhuignoto
Copy link
Owner

prabhuignoto commented Nov 10, 2020

Hi @ajeetshah,
Welcome to react-chrono. Thanks for raising a PR.

id, visible and active are internal properties and the consumers of the component should not manually pass this.

The current code does not overwrite any prop that consumers would ideally pass.

README has a clear instruction on list of allowed props for each timelineItem. https://github.com/prabhuignoto/react-chrono#timeline-item-model.

i am happy to help if there is a specific problem that you are facing while using the component.

@prabhuignoto prabhuignoto added the question Further information is requested label Nov 10, 2020
@ajeetshah
Copy link
Author

ajeetshah commented Nov 10, 2020

Hi @prabhuignoto, I was trying to mark the last item as active at first render. How can I do that? By default, the current code marks the first item as active with index === 0 in the code.

@prabhuignoto
Copy link
Owner

Thanks for your response. Can you please elaborate the UX use case for selecting the last item on load. Timelines are essentially sequential in nature and selecting last event/item on load goes against this.

@ajeetshah
Copy link
Author

ajeetshah commented Nov 10, 2020

Let's say we want to build something like Amazon "order status". So the timeline goes like: 1.Ordered, 2.Payment done, 3.Dispatched, 4.Out for delivery. And today the status is "out for delivery". Here, we would like to show the last item i.e. "4. Out for delivery" as active. Isn't it? Or maybe you are right, it is not needed as we can just reverse the items and last one will become the first and active by default.

@prabhuignoto
Copy link
Owner

The component right now supports only static timeline and the active is used internally for styling purposes only . Progress tracking is not something the component can handle right now and was built for ,but it would definitely be a great addition.

I can definitely see the component being used for live progress tracking scenarios and it's great you brought it up.

I am going to add a separate backlog item for this.

I had a look at the pr again now, Both the selection and auto scroll are failing when I select a timeline item.

@ajeetshah ajeetshah closed this Nov 10, 2020
@ajeetshah ajeetshah deleted the dont-overwrite-user-provided-item-props branch November 10, 2020 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants